]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/initscripts/init.d/networking/red.up/05-update-dns-forwarders
unbound: fix update forwarders if unbound was not running
[people/pmueller/ipfire-2.x.git] / src / initscripts / init.d / networking / red.up / 05-update-dns-forwarders
index be8879ca9e1ce3220a63086f984705d4ac52720e..4ff2e58ef746a628b35405cf5f448fba4f4693e5 100644 (file)
@@ -3,10 +3,11 @@
 # If network has not fully been brought up here, we start unbound
 # so that all following scripts can rely on DNS resolution
 
-# Update DNS forwarders if unbound is running
-if pgrep -q unbound; then
-       exec /etc/init.d/unbound update-forwarders
+pidof unbound > /dev/null
+if [ "${?}" = "0" ]; then
+       # unbound is run so update the forwarders
+       /etc/init.d/unbound update-forwarders
+else
+       # Start unbound if it is not running, yet
+       /etc/init.d/unbound start
 fi
-
-# Start unbound if it is not running, yet
-exec /etc/init.d/unbound start