summaryrefslogtreecommitdiff
path: root/bin/lazar-stop.sh
diff options
context:
space:
mode:
authorgebele <gebele@in-silico.ch>2016-05-12 15:35:03 +0000
committergebele <gebele@in-silico.ch>2016-05-12 15:35:03 +0000
commit80cdde4c5cd03829518772e71b0bee4133afe622 (patch)
tree2ea8bc5ba4f17b249f575ae93eac3aee02bd4e1d /bin/lazar-stop.sh
parent171d6e675a0e1c209340d2988e3a39d06999d18c (diff)
bumped version
Diffstat (limited to 'bin/lazar-stop.sh')
-rwxr-xr-xbin/lazar-stop.sh55
1 files changed, 35 insertions, 20 deletions
diff --git a/bin/lazar-stop.sh b/bin/lazar-stop.sh
index 26de413..f5ba963 100755
--- a/bin/lazar-stop.sh
+++ b/bin/lazar-stop.sh
@@ -1,24 +1,39 @@
#!/bin/bash
-#R CMD Rserve
-#sudo mongod
-#unicorn -p 8088 -E production
+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`
-RETVAL=0
+# 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
-stop() {
- grep_mongo=`ps aux | grep -v grep | grep mongod`
- if [ ${#grep_mongo} -gt 0 ]
- then
- echo "Stop MongoDB."
- PID=`ps ax | grep -v grep | grep mongod | awk '{ print $1 }'`
- for i in "${PID}"
- do
- `sudo kill -2 $i`
- done
- RETVAL=$?
- 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
-exit $RETVAL
+# 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