diff options
author | Christian Hesse <mail@eworm.de> | 2014-09-12 08:45:22 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2014-09-12 08:45:22 +0200 |
commit | e3ec3eb9a1760a8799929416d681311d35116d7c (patch) | |
tree | 1fb0cbe5f0f982df69166feefb64df8e516e8286 | |
parent | a52664bc7e567ee8fb37a07b70a3492cf55361fa (diff) | |
download | dhcpcd-hook-pdnsd-0.2.0.tar.gz dhcpcd-hook-pdnsd-0.2.0.tar.zst |
only run hook if pdnsd is running0.2.0
-rw-r--r-- | 21-pdnsd | 46 |
1 files changed, 24 insertions, 22 deletions
@@ -1,23 +1,25 @@ #!/bin/sh - -case "${reason}" in - BOUND|REBIND|REBOOT|RENEW|TIMEOUT|STATIC) - # Set the IP of "dynamic" entry for pdnsd - SRVS="" - for X in ${new_domain_name_servers}; do - if [ -z "${SRVS}" ]; then - SRVS="${X}" - else - SRVS="${SRVS},${X}" - fi - done - pdnsd-ctl server dynamic up ${SRVS} - ;; - PREINIT|EXPIRE|FAIL|IPV4LL|NAK|NOCARRIER|RELEASE|STOP) - # reset to values in /etc/pdnsd.conf - pdnsd-ctl config - ;; - INFORM) - # do nothing here - ;; -esac + +if pdnsd-ctl status >/dev/null 2>/dev/null; then + case "${reason}" in + BOUND|REBIND|REBOOT|RENEW|TIMEOUT|STATIC) + # Set the IP of "dynamic" entry for pdnsd + SRVS="" + for NAMESERVER in ${new_domain_name_servers}; do + if [ -z "${SRVS}" ]; then + SRVS="${NAMESERVER}" + else + SRVS="${SRVS},${NAMESERVER}" + fi + done + pdnsd-ctl server dynamic up ${SRVS} + ;; + PREINIT|EXPIRE|FAIL|IPV4LL|NAK|NOCARRIER|RELEASE|STOP) + # reset to values in /etc/pdnsd.conf + pdnsd-ctl config + ;; + INFORM) + # do nothing here + ;; + esac +fi |