]> git.pld-linux.org Git - packages/dhcp.git/blobdiff - dhcp-relay.init
- updated to 3.0.2rc1
[packages/dhcp.git] / dhcp-relay.init
index f47e3e0163485bef39caade133fe31a8c3f92349..d6e3f1e4cdfa6eaaaa407ca32d723cfe91014556 100644 (file)
 . /etc/sysconfig/dhcp-relay
 
 # Check that networking is up.
-if is_no "${NETWORKING}"; then
-       msg_network_down "DHCP realay"
-       exit 1
+if is_yes "${NETWORKING}"; then
+       if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+               msg_network_down "DHCP realay"
+               exit 1
+       fi
+else
+       exit 0
 fi
 
 if [ -n "DHCP_REALY_INTERFACES" ]; then
        OPTIONS="-i $DHCP_REALY_INTERFACES"
 fi
 
-
+RETVAL=0
 # See how we were called.
 case "$1" in
   start)
@@ -35,24 +39,29 @@ case "$1" in
                [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dhcp-relay
        else
                msg_already_running "DHCP relay"
-               exit 1
        fi
        ;;
   stop)
-       msg_stopping "DHCP relay"
-       killproc dhcrelay
-       rm -f /var/lock/subsys/dhcp-relay
+       if [ -f /var/lock/subsys/dhcp-relay ]; then
+               msg_stopping "DHCP relay"
+               killproc dhcrelay
+               rm -f /var/lock/subsys/dhcp-relay
+       else
+               msg_not_running "DHCP relay"
+       fi
        ;;
-  restart|reload)
+  restart|force-reload)
        $0 stop
        $0 start
+       exit $?
        ;;
   status)
        status dhcrelay
+       exit $?
        ;;
   *)
-       msg_usage "$0 {start|stop|restart|reload|status}"
-       exit 1
+       msg_usage "$0 {start|stop|restart|force-reload|status}"
+       exit 3
 esac
 
 exit $RETVAL
This page took 0.642052 seconds and 4 git commands to generate.