From: Arne Fitzenreiter Date: Tue, 4 Oct 2016 17:24:26 +0000 (+0200) Subject: unbound: fix update forwarders if unbound was not running X-Git-Tag: v2.19-core106~30^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a48a2034f5320baf32c10ec877d0c3c53cf4c699;p=people%2Fpmueller%2Fipfire-2.x.git unbound: fix update forwarders if unbound was not running psgrep has no "-q" switch so i use pidof. Signed-off-by: Arne Fitzenreiter --- diff --git a/src/initscripts/init.d/networking/red.up/05-update-dns-forwarders b/src/initscripts/init.d/networking/red.up/05-update-dns-forwarders index be8879ca9e..4ff2e58ef7 100644 --- a/src/initscripts/init.d/networking/red.up/05-update-dns-forwarders +++ b/src/initscripts/init.d/networking/red.up/05-update-dns-forwarders @@ -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