blob: 4fdcab7f55fa3f12d9506b070e05ef3c7a023ade [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001#!/bin/sh
2### BEGIN INIT INFO
3# Provides: nvram_daemon
4# Required-Start: $syslog $local_fs
5# Required-Stop: $syslog $local_fs
6# Default-Start: 2 3 4 5
7# Default-Stop: 0 1 6
8# Short-Description: nvram_daemon
9### END INIT INFO
10
11. /etc/init.d/init-functions
12prog=nvram_daemon
13PIDFILE=/var/run/$prog.pid
14DESC="nvram_daemon"
15start() {
16 log_daemon_msg "Starting $DESC" "$prog"
17 start_daemon_background -p $PIDFILE /sbin/nvram_daemon
18 if [ $? -ne 0 ]; then
19 log_end_msg 1
20 exit 1
21 fi
22 if [ $? -eq 0 ]; then
23 log_end_msg 0
24 fi
25 exit 0
26}
27
28stop() {
29 log_daemon_msg "Stopping $DESC" "$prog"
30 killproc -p $PIDFILE /sbin/nvram_daemon
31 if [ $? -ne 0 ]; then
32 log_end_msg 1
33 exit 1
34 fi
35 if [ $? -eq 0 ]; then
36 log_end_msg 0
37 fi
38}
39
40force_reload() {
41 stop
42 start
43
44}
45
46case "$1" in
47 start)
48 start
49 ;;
50 stop)
51 stop
52 ;;
53 force-reload)
54 force_reload
55 ;;
56 restart)
57 stop
58 start
59 ;;
60
61 *)
62 echo "$Usage: $prog {start|stop|force-reload|restart}"
63 exit 2
64esac