summaryrefslogtreecommitdiff
path: root/bin/lazar-stop.sh
diff options
context:
space:
mode:
authorgebele <gebele@in-silico.ch>2016-11-24 16:31:26 +0000
committergebele <gebele@in-silico.ch>2016-11-24 16:31:26 +0000
commitbfd31ed2c9d0cde8a53238c7368eb3d49c580b7d (patch)
tree91c3a2865302e1017db0dffb6015dfa3eb6c476f /bin/lazar-stop.sh
parentf0588c7e072ea3e22f26916d669e9baaa8fa3197 (diff)
parentf86c084311282036ffa7b4588c0fa0d5b59af95b (diff)
fixed merge
Diffstat (limited to 'bin/lazar-stop.sh')
-rwxr-xr-xbin/lazar-stop.sh52
1 files changed, 52 insertions, 0 deletions
diff --git a/bin/lazar-stop.sh b/bin/lazar-stop.sh
new file mode 100755
index 0000000..eea6815
--- /dev/null
+++ b/bin/lazar-stop.sh
@@ -0,0 +1,52 @@
+#!/bin/bash
+grep_lazar=`ps aux | grep -v grep | grep lazar-start`
+grep_mongo=`ps aux | grep -v grep | grep mongod`
+grep_rserve=`ps aux | grep -v grep | grep Rserve`
+grep_unicorn=`ps aux | grep -v grep | grep unicorn`
+
+# lazar
+if [ ${#grep_lazar} -gt 0 ]
+then
+ PID=`ps ax | grep -v grep | grep lazar-start | awk '{ print $1 }'`
+ for i in "${PID}"
+ do
+ `kill $i`
+ done
+else
+ echo "Lazar is stopped."
+fi
+
+# mongod
+if [ ${#grep_mongo} -gt 0 ]
+then
+ PID=`ps ax | grep -v grep | grep mongod | awk '{ print $1 }'`
+ for i in "${PID}"
+ do
+ `sudo kill $i`
+ done
+else
+ echo "MongoDB is not running."
+fi
+
+# rserve
+if [ ${#grep_rserve} -gt 0 ]
+then
+ PID=`ps ax | grep -v grep | grep Rserve | awk '{ print $1 }'`
+ for i in "${PID}"
+ do
+ `kill $i`
+ done
+else
+ echo "Rserve is not running."
+fi
+
+# unicorn
+if [ ${#grep_unicorn} -gt 0 ]
+then
+ PID=`ps ax | grep -v grep | grep unicorn | awk '{ print $1 }'`
+ `kill ${PID[0]}`
+else
+ echo "Unicorn is not running."
+fi
+
+exit 0