blob: 87504bf21212f8f87c4ebb1ba394fc4bab602b78 [file] [log] [blame]
#!/bin/sh
### BEGIN INIT INFO
# Provides: stp_dump
# Required-Start: $syslog $local_fs $remote_fs
# Required-Stop: $syslog $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: stp dump Daemon
### END INIT INFO
. /etc/init.d/init-functions
prog=stp_dump
PIDFILE=/var/run/$prog.pid
DESC="stp dump Daemon"
start() {
log_daemon_msg "Starting $DESC" "$prog"
start_daemon_background -p $PIDFILE /usr/bin/stp_dump
if [ $? -ne 0 ]; then
log_end_msg 1
exit 1
fi
if [ $? -eq 0 ]; then
log_end_msg 0
fi
exit 0
}
stop() {
log_daemon_msg "Stopping $DESC" "$prog"
killproc -p $PIDFILE /usr/bin/stp_dump
if [ $? -ne 0 ]; then
log_end_msg 1
exit 1
fi
if [ $? -eq 0 ]; then
log_end_msg 0
fi
}
force_reload() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
force-reload)
force_reload
;;
restart)
stop
start
;;
*)
echo "$Usage: $prog {start|stop|force-reload|restart}"
exit 2
esac