nodebbの起動スクリプト

#!/bin/sh

#
# chkconfig: 35 99 99
# description: Node.js

. /etc/rc.d/init.d/functions

prog="nodebb" 

do_start()
{
        cd /var/www/vhosts/nodebb
        ./nodebb start
        RETVAL=$?
        return $RETVAL
}

do_stop()
{
        cd /var/www/vhosts/nodebb
        ./nodebb stop
        RETVAL=$?
        return $RETVAL
}

case "$1" in
        start)
                do_start
                ;;
        stop)
                do_stop
                ;;
        status)
                cd /var/www/vhosts/nodebb
                ./nodebb status
                ;;
        restart)
                do_stop
                do_start
                ;;
        *)
                echo "Usage: $0 {start|stop|status|restart}" 
                RETVAL=1
esac

exit $RETVAL