Skip to content

Commit

Permalink
fix restart cmd (fix #28)
Browse files Browse the repository at this point in the history
  • Loading branch information
hobbyquaker committed Jul 11, 2018
1 parent 886b3b8 commit 6db440d
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions addon_files/redmatic/bin/redmatic
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,21 @@ Stop () {
PSPID=`ps -o pid,comm,args | awk '{if($3 == "node-red" || $4 ~ /node-red/){print $1}}'`
if [ "$PSPID" != "" ]
then
echo -n "Stopping Node-RED: "
kill $1 $PSPID 2>/dev/null || true
sleep 1
kill -0 $PSPID 2>/dev/null
if [ $? -eq 0 ]
then
sleep 3
kill -KILL $PSPID 2>/dev/null
fi
logger -t homematic -p user.info "stopped node-red"
echo "OK"
echo -n "Stopping Node-RED: "
kill $1 $PSPID 2>/dev/null || true
sleep 1
kill -0 $PSPID 2>/dev/null
if [ $? -eq 0 ]
then
sleep 3
kill -KILL $PSPID 2>/dev/null
fi
logger -t homematic -p user.info "stopped node-red"
echo "OK"
return 0
else
echo "Node-RED not running"
exit 1
return 1
fi
}

Expand All @@ -53,7 +54,7 @@ Start () {
case "$1" in

stop)
Stop
Stop || exit 1
;;

start)
Expand Down

0 comments on commit 6db440d

Please sign in to comment.