diff options
Diffstat (limited to 'ot-tools-user.sh')
-rw-r--r-- | ot-tools-user.sh | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/ot-tools-user.sh b/ot-tools-user.sh index 57c6c00..49278a1 100644 --- a/ot-tools-user.sh +++ b/ot-tools-user.sh @@ -32,6 +32,12 @@ otupdate() { return 1 fi cd - + cd $HOME/opentox-ruby/www/opentox/algorithm/bbrc-sample + if ! git pull; then + echo "Error! Pull for Bbrc-Sample failed." + return 1 + fi + cd - cd opentox-ruby LINK_DIR=`gem which opentox-ruby | sed 's/\/opentox-ruby.rb//'` if [ -h $LINK_DIR ]; then @@ -52,8 +58,8 @@ otupdate() { otstart() { otconfig otkill - bash -c "nohup redis-server $HOME/opentox-ruby/redis-*/redis.conf >/dev/null 2>&1 &" - bash -c "nohup nginx -c $HOME/opentox-ruby/nginx/conf/nginx.conf >/dev/null 2>&1 &" + nice bash -c "nohup redis-server $HOME/opentox-ruby/redis-*/redis.conf >/dev/null 2>&1 &" + nice bash -c "nohup nginx -c $HOME/opentox-ruby/nginx/conf/nginx.conf >/dev/null 2>&1 &" sleep 2 if ! pgrep -u $USER nginx>/dev/null 2>&1; then echo "Failed to start nginx."; fi if ! pgrep -u $USER redis-server>/dev/null 2>&1; then echo "Failed to start redis."; fi @@ -81,3 +87,11 @@ otkill() { for p in `pgrep -u $USER R 2>/dev/null`; do kill -9 $p; done } +# Check the server +otcheck() { + check_service=`cat $HOME/.opentox/config/production.yaml | grep opentox-algorithm | sed 's/.*\s//g' | sed 's/"//g'` + if [ -z "`curl -v $check_service 2>&1 | grep '200 OK'`" ]; then + otstart + fi +} + |