Fix dhcp initscript logic to handle failures properly (#3941)
authorFlorian Fainelli <florian@openwrt.org>
Thu, 28 Aug 2008 15:38:13 +0000 (15:38 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Thu, 28 Aug 2008 15:38:13 +0000 (15:38 +0000)
SVN-Revision: 12425

net/dhcp/files/dhcpd.init

index ea16f01be57f6792eceb84675f8c1de762a46503..c874552cc39659fe63969cdd647ca425fb3ec82c 100644 (file)
@@ -15,7 +15,7 @@ start() {
        
        /usr/sbin/dhcpd -q -cf $config_file -lf $lease_file
        
-       if [ $? -eq 0 ]; then
+       if [ $? -ne 0 ]; then
                echo "  isc-dhcpd failed to start"
        fi
 }
@@ -25,7 +25,7 @@ stop() {
        if [ -e $pid_file ]; then
                kill `cat $pid_file`
 
-               if [ $? -eq 0 ]; then
+               if [ $? -ne 0 ]; then
                        echo "  PID " `cat $pid_file` not found
                        echo "  Is the DHCP server running?"
                fi