-
Notifications
You must be signed in to change notification settings - Fork 0
shell scripts
Murky edited this page Sep 10, 2019
·
4 revisions
#! /bin/bash
clear
echo ""
echo "###########################"
echo "## OPA APP Starting! ##"
echo "###########################"
echo ""
APP_PATH="/home/ubuntu/opa-app"
echo "APP Path: $APP_PATH"
cd $APP_PATH
nohup yarn serve & > /dev/null #can use npm instead of yarn
#! /bin/bash
clear
echo ""
echo "###########################"
echo "## OPA APP Stopping! ##"
echo "###########################"
echo ""
PROCESS_NAME="things-factory"
echo "Process Name: $PROCESS_NAME"
PID=`/bin/ps -ef | grep $PROCESS_NAME | grep -v grep | awk '{print $2}'`
#if [ -z "$PID"]; then
# echo "empty pid"
#fi
#echo $PID
while [[ ! -z "$PID" ]]
do
kill -TERM $PID
PID=`/bin/ps -ef | grep $PROCESS_NAME | grep -v grep | awk '{print $2}'`
done
echo "Done!"