9ba8b65
#!/bin/bash
9ba8b65
e812a0f
INTERFACE=$1 # The interface which is brought up or down
e812a0f
STATUS=$2 # The new state of the interface
9ba8b65
e812a0f
# whenever interface is brought up by NM (rhbz #565921)
e812a0f
if [ "$STATUS" = "up" ]; then
001230e
    # wait a few seconds to allow interface startup to complete
001230e
    # (important at boot time without this the service still fails
001230e
    # 2 seconds is too short, 5 seconds works - davebooth)
001230e
    sleep 5
e812a0f
    # restart the services
e812a0f
    systemctl -q is-enabled dhcpd.service && systemctl restart dhcpd.service
e812a0f
    systemctl -q is-enabled dhcpd6.service && systemctl restart dhcpd6.service
9ba8b65
fi
30b7632
30b7632
exit 0