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