philipp / rpms / dhcp

Forked from rpms/dhcp 4 years ago
Clone

Blame SOURCES/12-dhcpd

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