Skip to content

Commit 8f10d49

Browse files
committed
bug fixes
1 parent e1f0375 commit 8f10d49

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

structure/system/etc/init.d/99dnscrypt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ case "$1" in
7878
checkpid
7979
status=$?
8080

81-
if[ ! $status -eq 0 ]; then
81+
if [ $status -ne 0 ]; then
8282
log_info_msg "Starting $DESC"
8383
nohup $DAEMON -config $CONFIG_FILE -- $DAEMON_ARGS \
8484
-pidfile=$PIDFILE >/dev/null 2>&1 &
8585
pid=$! && echo $pid > $PIDFILE
8686

87-
if test wait_for_daemon $pid
87+
if wait_for_daemon $pid
8888
then
8989
log_info_msg "Enabling iptables firewall rules"
9090
do_iptables_rules 0
@@ -106,19 +106,19 @@ case "$1" in
106106
checkpid
107107
status=$?
108108

109-
if[ $status -eq 1 ]; then
109+
if [ $status -eq 1 ]; then
110110
log_info_msg "not running - there is no $PIDFILE"
111111
exit 1
112112
else
113113
log_info_msg "Stopping $DESC $NAME"
114114
pid=`cat $PIDFILE 2>/dev/null` || true
115+
rm $PIDFILE
115116

116117
if kill $pid 2>/dev/null; then
117118
log_info_msg "Disabling iptables firewall rules"
118119
do_iptables_rules 1
119-
rm $PIDFILE
120120
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?"
122122
exit 1
123123
else
124124
log_error_msg "$DAEMON died: process $pid not running; or permission denied."
@@ -133,7 +133,7 @@ case "$1" in
133133

134134
EXITSTATUS=${STATUS_CODE[status]}
135135

136-
if[ $status -eq 0 ]; then
136+
if [ $status -eq 0 ]; then
137137
EXITSTATUS=${STATUS_CODE[status]}" (PID `cat $PIDFILE`)"
138138
fi
139139

0 commit comments

Comments
 (0)