SE HUBの起動スクリプト (debian用)

次はRedHat用も書いておこうかな。

#!/bin/sh
#
# start/stop SoftEther HUB.
SEHUBDIR="/usr/local/bin"
SEHUB="/usr/local/bin/se_hub"

if ! [ -x $SEHUB ]; then
        exit 0
fi

case "$1" in
    start)
        echo -n "Starting SoftEther HUB:"
        echo "."
        cd $SEHUBDIR
        nohup $SEHUB &
        ;;
    stop)
        echo -n "Stopping SoftEther HUB:"
        killall se_hub
        echo "."
        ;;
    restart)
        echo -n "Restarting SoftEther HUB:"
        killall se_hub
        cd $SEHUBDIR
        nohup $SEHUB &
        echo "."
        ;;
    *)
        echo "Usage: /etc/init.d/se {start|stop|restart}"
        exit 1
        ;;
esac

exit 0