summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Maunz <andreas@maunz.de>2012-05-24 11:18:36 +0200
committerAndreas Maunz <andreas@maunz.de>2012-05-24 11:18:36 +0200
commitb5f9186a72cb2dc107e65e5d50baa57d42f7658d (patch)
treea6d08caa62bb4e54c263f148b1c0ab7b6871bba4
parent3673d175b95ac3d675f52c19951a9cb6d16a11e7 (diff)
Added otcheck and nice
-rw-r--r--ot-tools-user.sh12
1 files changed, 10 insertions, 2 deletions
diff --git a/ot-tools-user.sh b/ot-tools-user.sh
index 57c6c00..b002db6 100644
--- a/ot-tools-user.sh
+++ b/ot-tools-user.sh
@@ -52,8 +52,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 +81,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
+}
+