|
|
324fcf |
#!/bin/bash
|
|
|
324fcf |
|
|
|
324fcf |
INTERFACE=$1 # The interface which is brought up or down
|
|
|
324fcf |
STATUS=$2 # The new state of the interface
|
|
|
324fcf |
|
|
|
324fcf |
# whenever interface is brought up by NM (rhbz #565921)
|
|
|
324fcf |
if [ "$STATUS" = "up" ]; then
|
|
|
324fcf |
# wait a few seconds to allow interface startup to complete
|
|
|
324fcf |
# (important at boot time without this the service still fails
|
|
|
324fcf |
# time-out for dispatcher script is 3s (rhbz#1003695#8)
|
|
|
324fcf |
sleep 2
|
|
|
324fcf |
# restart the services
|
|
|
324fcf |
# In case this dispatcher script is called several times in a short period of time, it might happen that
|
|
|
324fcf |
# systemd refuses to further restart the units. Therefore we use reset-failed command to prevent it.
|
|
|
324fcf |
systemctl -q is-enabled dhcpd.service && systemctl restart dhcpd.service && systemctl reset-failed dhcpd.service
|
|
|
324fcf |
systemctl -q is-enabled dhcpd6.service && systemctl restart dhcpd6.service && systemctl reset-failed dhcpd6.service
|
|
|
324fcf |
fi
|
|
|
324fcf |
|
|
|
324fcf |
exit 0
|