-
Notifications
You must be signed in to change notification settings - Fork 8
/
hda-ctl.initscript
executable file
·84 lines (72 loc) · 1.5 KB
/
hda-ctl.initscript
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/sh
#
# hda-ctl This shell script takes care of starting and stopping hda-ctl.
#
# chkconfig: 345 65 35
# description: hda-ctl provides support for dynamically updating DHCP/DNS services
# processname: hda-ctl
# config: /etc/sysconfig/hda-ctl
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ "$NETWORKING" = "no" ] && exit 0
. /etc/sysconfig/hda-ctl
exec="/usr/bin/hda-ctl"
prog=$(basename $exec)
lockfile=/var/lock/subsys/$prog
start() {
if [ -f $lockfile ]; then
return 0
fi
if [ ! -e /var/cache/hda-ctl.cache ]; then
logger "hda-ctl: this hda has not been completely installed; exiting"
return 0
fi
echo -n $"Starting $prog: "
daemon $exec $HDA_CTL_OPTIONS
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
return $retval
}
stop() {
echo -n $"Stopping $prog: "
killproc $prog
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
}
restart() {
stop
start
}
reload() {
restart
}
force_reload() {
restart
}
fdrstatus() {
status $prog
}
# See how we were called.
case "$1" in
start|stop|restart|reload)
$1
;;
force-reload)
force_reload
;;
status)
fdrstatus
;;
condrestart)
[ ! -f $lockfile ] || restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}"
exit 2
esac