more graceful handling of missing pidfile, #1395

v1.18.x
Julian Lam 11 years ago
parent 20d1723e84
commit d95398f808

@ -33,13 +33,25 @@ case "$1" in
;; ;;
stop) stop)
echo "Stopping NodeBB. Goodbye!"; pidExists;
kill $(cat pidfile); if [ 0 -eq $? ];
then
echo "NodeBB is already stopped.";
else
echo "Stopping NodeBB. Goodbye!";
kill $(cat pidfile);
fi
;; ;;
reload|restart) reload|restart)
echo "Restarting NodeBB."; pidExists;
kill -1 $(cat pidfile); if [ 0 -eq $? ];
then
echo "NodeBB could not be restarted, as a running instance could not be found.";
else
echo "Restarting NodeBB.";
kill -1 $(cat pidfile);
fi
;; ;;
status) status)

Loading…
Cancel
Save