From 678a9e60be4a9a6b0c59969a0f6e0266885337fa Mon Sep 17 00:00:00 2001 From: gebele Date: Mon, 31 Oct 2016 16:09:18 +0000 Subject: updated README; added service commands for the gem --- bin/nano-lazar-stop.sh | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 bin/nano-lazar-stop.sh (limited to 'bin/nano-lazar-stop.sh') diff --git a/bin/nano-lazar-stop.sh b/bin/nano-lazar-stop.sh new file mode 100644 index 0000000..ec91982 --- /dev/null +++ b/bin/nano-lazar-stop.sh @@ -0,0 +1,52 @@ +#!/bin/bash +grep_nano_lazar=`ps aux | grep -v grep | grep nano-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 nano-lazar-start | awk '{ print $1 }'` + for i in "${PID}" + do + `kill $i` + done +else + echo "nano-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 -- cgit v1.2.3