Blame SOURCES/12-dhcpd

fad460
#!/bin/bash
fad460
fad460
INTERFACE=$1 # The interface which is brought up or down
fad460
STATUS=$2 # The new state of the interface
fad460
fad460
# whenever interface is brought up by NM (rhbz #565921)
fad460
if [ "$STATUS" = "up" ]; then
fad460
    # restart the services
fad460
    # In case this dispatcher script is called several times in a short period of time, it might happen that
fad460
    # systemd refuses to further restart the units. Therefore we use reset-failed command to prevent it.
fad460
    systemctl -q is-enabled dhcpd.service && systemctl restart dhcpd.service && systemctl reset-failed dhcpd.service
fad460
    systemctl -q is-enabled dhcpd6.service && systemctl restart dhcpd6.service && systemctl reset-failed dhcpd6.service
fad460
fi
fad460
fad460
exit 0