5
5
addService() {
6
6
app_name=$1
7
7
if hash update-rc.d >/dev/null 2>&1; then
8
- echo "Adding $app_name to service management using update-rc.d"
9
- update-rc.d $app_name defaults
8
+ echo "Adding $app_name to service management using update-rc.d"
9
+ update-rc.d $app_name defaults
10
10
elif hash chkconfig >/dev/null 2>&1; then
11
- echo "Adding $app_name to service management using chkconfig"
12
- chkconfig --add ${{app_name}}
13
- chkconfig $app_name on
11
+ echo "Adding $app_name to service management using chkconfig"
12
+ chkconfig --add ${{app_name}}
13
+ chkconfig $app_name on
14
14
else
15
- echo "WARNING: Could not add $app_name to autostart: neither update-rc nor chkconfig found!"
15
+ echo "WARNING: Could not add $app_name to autostart: neither update-rc nor chkconfig found!"
16
16
fi
17
17
}
18
18
@@ -32,16 +32,16 @@ startService() {
32
32
stopService() {
33
33
app_name=$1
34
34
if hash update-rc.d >/dev/null 2>&1; then
35
- echo "Removing $app_name from autostart using update-rc.d"
36
- update-rc.d -f $app_name remove
37
- service $app_name stop
35
+ echo "Removing $app_name from autostart using update-rc.d"
36
+ update-rc.d -f $app_name remove
37
+ service $app_name stop
38
38
elif hash chkconfig >/dev/null 2>&1; then
39
- echo "Removing $app_name from autostart using chkconfig"
40
- chkconfig $app_name off
41
- chkconfig --del $app_name
42
- service $app_name stop
39
+ echo "Removing $app_name from autostart using chkconfig"
40
+ chkconfig $app_name off
41
+ chkconfig --del $app_name
42
+ service $app_name stop
43
43
else
44
- echo "WARNING: Could not remove $app_name from autostart: neither update-rc nor chkconfig found!"
44
+ echo "WARNING: Could not remove $app_name from autostart: neither update-rc nor chkconfig found!"
45
45
fi
46
46
}
47
47
@@ -50,6 +50,6 @@ stopService() {
50
50
# $1 = service name
51
51
#
52
52
restartService() {
53
- app_name=$1
54
- service $app_name restart
53
+ app_name=$1
54
+ service $app_name restart
55
55
}
0 commit comments