blob: 4fdcab7f55fa3f12d9506b070e05ef3c7a023ade [file] [log] [blame]
#!/bin/sh
### BEGIN INIT INFO
# Provides: nvram_daemon
# Required-Start: $syslog $local_fs
# Required-Stop: $syslog $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: nvram_daemon
### END INIT INFO
. /etc/init.d/init-functions
prog=nvram_daemon
PIDFILE=/var/run/$prog.pid
DESC="nvram_daemon"
start() {
log_daemon_msg "Starting $DESC" "$prog"
start_daemon_background -p $PIDFILE /sbin/nvram_daemon
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 /sbin/nvram_daemon
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