psychobunny 11 years ago
commit 1804373322

@ -4,6 +4,19 @@
# $1 action # $1 action
# $2 subaction # $2 subaction
function pidExists() {
if [ -e "pidfile" ];
then
kill -s 0 $(cat pidfile);
if [ !$? ];
then return 1;
else return 0;
fi
else
return 0;
fi
}
case "$1" in case "$1" in
start) start)
echo "Starting NodeBB"; echo "Starting NodeBB";
@ -15,12 +28,28 @@ case "$1" in
stop) stop)
echo "Stopping NodeBB. Goodbye!"; echo "Stopping NodeBB. Goodbye!";
kill `cat pidfile`; kill $(cat pidfile);
;; ;;
reload|restart) reload|restart)
echo "Restarting NodeBB."; echo "Restarting NodeBB.";
kill -1 `cat pidfile`; kill -1 $(cat pidfile);
;;
status)
pidExists;
if [ 0 -eq $? ];
then
echo "NodeBB is not running";
echo " \"./nodebb start\" to launch the NodeBB server";
return 1;
else
echo "NodeBB Running (pid $(cat pidfile))";
echo " \"./nodebb stop\" to stop the NodeBB server";
echo " \"./nodebb log\" to view server output";
echo " \"./nodebb restart\" to restart NodeBB";
return 0;
fi
;; ;;
log) log)

Loading…
Cancel
Save