summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkurono <kurono@riseup.net>2019-07-03 23:49:52 +0200
committerkurono <kurono@riseup.net>2019-07-03 23:49:52 +0200
commit26526b4f6cb141a016c6049d301edbce43994833 (patch)
treebd1a9234311c223a06abd781eeb298595d8404ea
parent604d983d6594c524558c8204aa6a0f16d9b6dcf6 (diff)
fix bash problem error in 00-resolv-over-clearnet. refs #9372.kurono/feature/9372-Use-set-e-set-u-shel-scripts
-rwxr-xr-xconfig/chroot_local-includes/etc/NetworkManager/dispatcher.d/00-resolv-over-clearnet12
1 files changed, 7 insertions, 5 deletions
diff --git a/config/chroot_local-includes/etc/NetworkManager/dispatcher.d/00-resolv-over-clearnet b/config/chroot_local-includes/etc/NetworkManager/dispatcher.d/00-resolv-over-clearnet
index 5375120..3c7cdf6 100755
--- a/config/chroot_local-includes/etc/NetworkManager/dispatcher.d/00-resolv-over-clearnet
+++ b/config/chroot_local-includes/etc/NetworkManager/dispatcher.d/00-resolv-over-clearnet
@@ -19,8 +19,10 @@ RESOLV_CLEARNET_CONF=/etc/resolv-over-clearnet.conf
# bind-mount would remain outdated.
echo -n > "${RESOLV_CLEARNET_CONF}"
IP4_REGEX='[0-9]{1,3}(\.[0-9]{1,3}){3}'
-for ns in ${IP4_NAMESERVERS}; do
- if echo "${ns}" | grep --extended-regexp -q "^${IP4_REGEX}$"; then
- echo "nameserver ${ns}" >> "${RESOLV_CLEARNET_CONF}"
- fi
-done
+if [ ! -z ${IP4_NAMESERVERS+x} ]; then
+ for ns in ${IP4_NAMESERVERS}; do
+ if echo "${ns}" | grep --extended-regexp -q "^${IP4_REGEX}$"; then
+ echo "nameserver ${ns}" >> "${RESOLV_CLEARNET_CONF}"
+ fi
+ done
+fi