-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsc.init
executable file
·64 lines (52 loc) · 1.03 KB
/
sc.init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/sh
### BEGIN INIT INFO
# Provides: sc
# Required-Start: $remote_fs $syslog $network
# Required-Stop: $remote_fs $syslog $network
# Default-Start: 2 3 4 5
# Default-Stop: 1
# Short-Description: Shaper Control Tool
### END INIT INFO
set -e
# /etc/init.d/sc: init script for Shaper Control Tool
SC=/usr/local/sbin/sc
test -x $SC || exit 0
if test -f /etc/default/sc; then
. /etc/default/sc
fi
. /lib/lsb/init-functions
if [ -n "$2" ]; then
SC_OPTS="$SC_OPTS $2"
fi
case "$1" in
start)
log_daemon_msg "Starting shaper" "sc"
if $SC $SC_OPTS load ; then
log_end_msg 0
else
log_end_msg 1
fi
;;
stop)
log_daemon_msg "Stopping shaper" "sc"
if $SC $SC_OPTS reset ; then
log_end_msg 0
else
log_end_msg 1
fi
;;
restart|reload|force-reload)
log_daemon_msg "Restarting shaper" "sc"
if $SC $SC_OPTS reload ; then
log_end_msg 0
else
log_end_msg 1
fi
;;
status)
$SC $SC_OPTS status
;;
*)
log_action_msg "Usage: /etc/init.d/sc {start|stop|reload|force-reload|restart|status}"
exit 1
esac