|
|
9b9effa |
#!/bin/bash
|
|
|
9b9effa |
export LC_ALL=C
|
|
|
9b9effa |
|
|
|
9b9effa |
[ -f /etc/sysconfig/dhcpd ] && . /etc/sysconfig/dhcpd
|
|
|
9b9effa |
|
|
|
9b9effa |
# restart dhcpd whenever $1 interface is brought up by NM (rhbz #565921)
|
|
|
9b9effa |
if [ "$2" = "up" ]; then
|
|
|
9b9effa |
# exit if the service is not configured to be started in the current runlevel
|
|
|
9b9effa |
/sbin/chkconfig dhcpd || exit 0
|
|
|
9b9effa |
|
|
|
9b9effa |
# exit if dhcpd is not defined to listen on $1
|
|
|
9b9effa |
# i.e. if there are interfaces defined in DHCPDARGS and $1 is not among them
|
|
|
9b9effa |
if [ -n "${DHCPDARGS}" ] &&
|
|
|
9b9effa |
[[ "${DHCPDARGS}" == *eth* ]] &&
|
|
|
9b9effa |
[[ "${DHCPDARGS}" != *$1* ]]; then
|
|
|
9b9effa |
exit 0
|
|
|
9b9effa |
fi
|
|
|
9b9effa |
|
|
|
9b9effa |
# restart service
|
|
|
9b9effa |
/sbin/service dhcpd restart || :
|
|
|
9b9effa |
fi
|