-
Notifications
You must be signed in to change notification settings - Fork 8
/
amahi-installer.initscript
executable file
·78 lines (67 loc) · 1.39 KB
/
amahi-installer.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
#!/bin/sh
#
# amahi-installer This shell script takes care of starting and stopping the amahi-installer.
#
# chkconfig: 345 65 35
# description: amahi-installer provides support for running amahi-installer
# processname: amahi-installer
# 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
exec="/usr/bin/amahi-installer"
prog=$(basename $exec)
lockfile=/var/lock/subsys/$prog
start() {
if [ -f $lockfile ]; then
return 0
fi
echo -n $"Starting $prog: "
daemon $exec -q
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
return $retval
}
stop() {
echo -n $"Stopping $prog: "
killproc /usr/share/hda-ctl/web-installer/install-server
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|restart|condrestart|reload|force-reload}"
exit 2
esac