Observer embryo, Maestro done
This commit is contained in:
+26
-6
@@ -1,13 +1,33 @@
|
||||
#!/bin/sh
|
||||
|
||||
cd /opt/p42GodDaemons/GPS/
|
||||
. /etc/p42/secrets.env
|
||||
|
||||
daemon=p42Gps
|
||||
logfile=gps.log
|
||||
|
||||
|
||||
pid=$(pgrep -f "$daemon")
|
||||
|
||||
pid=`ps -ef | grep p42Gps |grep -v grep | awk '{print $2}'`
|
||||
if [ -z "$pid" ]
|
||||
then
|
||||
node p42Gps.js --debug > gps.log 2>&1 &
|
||||
node "${daemon}.js" --debug > "$logfile" 2>&1 &
|
||||
pid=$!
|
||||
|
||||
sleep 1
|
||||
|
||||
if kill -0 "$pid" 2>/dev/null
|
||||
then
|
||||
echo ""
|
||||
echo "$daemon is now running with PID=$pid"
|
||||
echo ""
|
||||
else
|
||||
echo ""
|
||||
echo "Failed to start $daemon. Check gps.log"
|
||||
echo ""
|
||||
fi
|
||||
else
|
||||
echo ''
|
||||
echo 'Already running PID='"$pid"' (use stopGps.sh to stop it)'
|
||||
echo ''
|
||||
echo ""
|
||||
echo "$daemon is already running with PID=$pid"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user