]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - src/initscripts/system/unbound
unbound: check if red/iface exists before read it
[ipfire-2.x.git] / src / initscripts / system / unbound
index ccb5fae219430119746f3cc9ca0e2c94d1242efb..5d3c5062ff5accbd8fa13f038d78595282023b1f 100644 (file)
@@ -48,7 +48,7 @@ config_header() {
 }
 
 update_forwarders() {
 }
 
 update_forwarders() {
-       if [ "${USE_FORWARDERS}" = "1" -a "$(</sys/class/net/$(</var/ipfire/red/iface)/carrier)" = "1" ]; then
+       if [ "${USE_FORWARDERS}" = "1" -a -e "/var/ipfire/red/iface" -a "$(</sys/class/net/$(</var/ipfire/red/iface)/carrier)" = "1" ]; then
                local forwarders
                local broken_forwarders
 
                local forwarders
                local broken_forwarders
 
@@ -473,7 +473,7 @@ disable_dnssec() {
 fix_time_if_dns_fail() {
        # If DNS still not work try to init ntp with
        # hardcoded ntp.ipfire.org (81.3.27.46)
 fix_time_if_dns_fail() {
        # If DNS still not work try to init ntp with
        # hardcoded ntp.ipfire.org (81.3.27.46)
-       if [ "$(</sys/class/net/$(</var/ipfire/red/iface)/carrier)" = "1" ]; then
+       if [ -e "/var/ipfire/red/iface" -a "$(</sys/class/net/$(</var/ipfire/red/iface)/carrier)" = "1" ]; then
                host 0.ipfire.pool.ntp.org > /dev/null 2>&1
                if [ "${?}" != "0" ]; then
                        boot_mesg "DNS still not functioning... Trying to sync time with ntp.ipfire.org (81.3.27.46)..."
                host 0.ipfire.pool.ntp.org > /dev/null 2>&1
                if [ "${?}" != "0" ]; then
                        boot_mesg "DNS still not functioning... Trying to sync time with ntp.ipfire.org (81.3.27.46)..."