@@ -78,13 +78,13 @@ case "$1" in
78
78
checkpid
79
79
status=$?
80
80
81
- if[ ! $status -eq 0 ]; then
81
+ if [ $status -ne 0 ]; then
82
82
log_info_msg " Starting $DESC "
83
83
nohup $DAEMON -config $CONFIG_FILE -- $DAEMON_ARGS \
84
84
-pidfile=$PIDFILE > /dev/null 2>&1 &
85
85
pid=$! && echo $pid > $PIDFILE
86
86
87
- if test wait_for_daemon $pid
87
+ if wait_for_daemon $pid
88
88
then
89
89
log_info_msg " Enabling iptables firewall rules"
90
90
do_iptables_rules 0
@@ -106,19 +106,19 @@ case "$1" in
106
106
checkpid
107
107
status=$?
108
108
109
- if[ $status -eq 1 ]; then
109
+ if [ $status -eq 1 ]; then
110
110
log_info_msg " not running - there is no $PIDFILE "
111
111
exit 1
112
112
else
113
113
log_info_msg " Stopping $DESC $NAME "
114
114
pid=` cat $PIDFILE 2> /dev/null` || true
115
+ rm $PIDFILE
115
116
116
117
if kill $pid 2> /dev/null; then
117
118
log_info_msg " Disabling iptables firewall rules"
118
119
do_iptables_rules 1
119
- rm $PIDFILE
120
120
elif kill -0 $pid 2> /dev/null; then
121
- log_info_msg 1 " Is $pid not $NAME ?"
121
+ log_info_msg " Is $pid not $NAME ?"
122
122
exit 1
123
123
else
124
124
log_error_msg " $DAEMON died: process $pid not running; or permission denied."
@@ -133,7 +133,7 @@ case "$1" in
133
133
134
134
EXITSTATUS=${STATUS_CODE[status]}
135
135
136
- if[ $status -eq 0 ]; then
136
+ if [ $status -eq 0 ]; then
137
137
EXITSTATUS=${STATUS_CODE[status]} " (PID ` cat $PIDFILE ` )"
138
138
fi
139
139
0 commit comments