X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=dhcp-relay.init;h=a76b49d53b97a90fe6d6cf965e77a52eb526ef16;hb=8eb9d6a866742c82a19b71002fd8b767e2717909;hp=f56a1f7ca597e7fdf1cd8b854333490f1c5940eb;hpb=dfbb7f59e4806d6505a5d9df17ca0f4d24607068;p=packages%2Fdhcp.git diff --git a/dhcp-relay.init b/dhcp-relay.init index f56a1f7..a76b49d 100644 --- a/dhcp-relay.init +++ b/dhcp-relay.init @@ -11,11 +11,12 @@ . /etc/sysconfig/network # Demon specified configuration. +OPTIONS="" . /etc/sysconfig/dhcp-relay # Check that networking is up. if is_yes "${NETWORKING}"; then - if [ ! -f /var/lock/subsys/network ]; then + if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then msg_network_down "DHCP realay" exit 1 fi @@ -23,11 +24,13 @@ else exit 0 fi -if [ -n "DHCP_REALY_INTERFACES" ]; then - OPTIONS="-i $DHCP_REALY_INTERFACES" +if [ -n "DHCP_RELAY_INTERFACES" ]; then + for iface in $DHCP_RELAY_INTERFACES ; do + OPTIONS="$OPTIONS -i $iface" + done fi - +RETVAL=0 # See how we were called. case "$1" in start) @@ -39,24 +42,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