diff options
author | zsloan | 2016-09-12 11:39:55 -0500 |
---|---|---|
committer | GitHub | 2016-09-12 11:39:55 -0500 |
commit | d3ee8ad4b193cdcb9762a267955a2778ea75dc5a (patch) | |
tree | f26008c7b4863c055b18e86f2298ed6116225b6d /bin | |
parent | 11d04b1e6e7bac4d0eb0f9d8f8c5be57d6cb2ebd (diff) | |
parent | 5e106bad6e59d3a13be0b79715785948a3ff581a (diff) | |
download | genenetwork2-d3ee8ad4b193cdcb9762a267955a2778ea75dc5a.tar.gz |
Merge pull request #180 from pjotrp/zsloan
Support maintenance scripts
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/genenetwork2 | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/bin/genenetwork2 b/bin/genenetwork2 index d3bf3299..3a8c3ff4 100755 --- a/bin/genenetwork2 +++ b/bin/genenetwork2 @@ -1,6 +1,14 @@ #! /bin/bash # -# This will run the GN2 server (with default settings if none supplied). +# This will run the GN2 server (with default settings if none supplied). Pass in +# your own settings file, e.g. +# +# ./bin/genenetwork2 ~/my_settings.py +# +# To run a maintenance script with settings (instead of the webserver) add that with +# a -c switch, e.g. +# +# ./bin/genenetwork2 ~/my_settings.py -c ./wqflask/maintenance/gen_select_dataset.py # # Environment settings can be used to preconfigure as well as a # settings.py file. @@ -18,7 +26,12 @@ echo $GN2_BASE_PATH # Handle settings parameter settings=$1 -if [ -z $settings ]; then settings=$GN2_BASE_PATH/etc/default_settings.py ; fi +if [ -z $settings ]; then + # get default + settings=$GN2_BASE_PATH/etc/default_settings.py +else + shift +fi if [ ! -e $settings ]; then echo "ERROR: can not locate settings file - pass it in the command line" exit 1 @@ -32,7 +45,15 @@ export PYTHONPATH=$GN2_BASE_PATH/wqflask:$PYTHONPATH if [ -z $TEMPDIR ]; then TEMPDIR="/tmp" fi - + +# Now handle command parameter -c +if [ $1 = '-c' ] ; then + echo PYTHONPATH=$PYTHONPATH + echo RUNNING COMMAND $2 + /usr/bin/env python $2 + exit 0 +fi + echo "Starting the redis server:" echo -n "dir $TEMPDIR dbfilename gn2.rdb |