From 171d6e675a0e1c209340d2988e3a39d06999d18c Mon Sep 17 00:00:00 2001 From: gebele Date: Thu, 12 May 2016 10:21:50 +0000 Subject: added start and stop script --- bin/lazar-stop.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 bin/lazar-stop.sh (limited to 'bin/lazar-stop.sh') diff --git a/bin/lazar-stop.sh b/bin/lazar-stop.sh new file mode 100755 index 0000000..26de413 --- /dev/null +++ b/bin/lazar-stop.sh @@ -0,0 +1,24 @@ +#!/bin/bash +#R CMD Rserve +#sudo mongod +#unicorn -p 8088 -E production + +RETVAL=0 + +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 +} + +exit $RETVAL -- cgit v1.2.3