X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=dhcp6.init;h=efbe991e334cfc20e8193d60c4ffbbfa4dfb9ef3;hb=refs%2Fheads%2Fmaster;hp=f378ee33c226c4e70ba45efe91e314716111d073;hpb=86fe3b99eb29b8d70d69cd8447590c5e48bcff2a;p=packages%2Fdhcp.git diff --git a/dhcp6.init b/dhcp6.init index f378ee3..efbe991 100644 --- a/dhcp6.init +++ b/dhcp6.init @@ -10,17 +10,17 @@ # Get network config . /etc/sysconfig/network +# Check that networking is up. +if ! is_yes "${IPV6_NETWORKING}"; then + exit 0 +fi + # Get service config [ -f /etc/sysconfig/dhcpd ] && . /etc/sysconfig/dhcpd -# Check that networking is up. -if is_yes "${IPV6_NETWORKING}"; then - if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then - msg_network_down "DHCP IPv6 Server" - exit 1 - fi -else - exit 0 +if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then + msg_network_down "DHCP IPv6 Server" + exit 1 fi check_device_up() @@ -36,7 +36,7 @@ check_device_up() # configtest itself configtest() { local rc=0 - /sbin/dhcpd -6 -pf /var/run/dhpcd6.pid -q -t -T || rc=$? + /sbin/dhcpd -6 -t -T -cf /etc/dhcpd6.conf -pf /var/run/dhcpd6.pid || rc=$? # check if interfaces specified exist and have addresses for i in $DHCPD_INTERFACES; do @@ -55,17 +55,17 @@ checkconfig() { local details=${1:-0} # run checkconfig only once - if [ "$checkconfig" != -1 ]; then + if [ $checkconfig -ne -1 ]; then return $checkconfig fi - if [ $details = 1 ]; then + if [ "$details" = "1" ]; then # run config test and display report (status action) show "Checking %s configuration" "DHCP IPv6 Server"; busy local out out=$(configtest 2>&1) checkconfig=$? - if [ $checkconfig = 0 ]; then + if [ $checkconfig -eq 0 ]; then ok else fail @@ -77,7 +77,7 @@ checkconfig() { # (for actions checking status before action). configtest >/dev/null 2>&1 checkconfig=$? - if [ $checkconfig != 0 ]; then + if [ $checkconfig -ne 0 ]; then show "Checking %s configuration" "DHCP IPv6 Server"; fail nls 'Configuration test failed. See details with %s "checkconfig"' $0 exit $checkconfig @@ -94,7 +94,7 @@ start() { checkconfig msg_starting "DHCP IPv6 Server" - daemon /sbin/dhcpd -6 -pf /var/run/dhpcd6.pid -q $DHCPD_INTERFACES + daemon /sbin/dhcpd -6 -q -cf /etc/dhcpd6.conf -pf /var/run/dhcpd6.pid $DHCPD_INTERFACES RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dhcpd6 }