OK, I've pushed code to git as described by the attached patch with
the resulting attached /etc/dhcp/dhclient-enter-hooks.d/resolvconf.
Will be released as 1.77.
-- 
Thomas
diff --git a/debian/changelog b/debian/changelog
index eb219dd..7f925b8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+resolvconf (1.77) unstable; urgency=medium
+
+  * [eb81ca0] Eliminate bashisms.
+    Thanks to Michael Gilbert (Closes: #775356)
+
+ -- Thomas Hood <jdth...@gmail.com>  Fri, 23 Jan 2015 21:46:34 +0100
+
 resolvconf (1.76) unstable; urgency=low
 
   * resolvconf.service: Install into sysinit.target, not into
diff --git a/etc/dhcp/dhclient-enter-hooks.d/resolvconf b/etc/dhcp/dhclient-enter-hooks.d/resolvconf
index 529504b..72b2be7 100644
--- a/etc/dhcp/dhclient-enter-hooks.d/resolvconf
+++ b/etc/dhcp/dhclient-enter-hooks.d/resolvconf
@@ -23,7 +23,7 @@ if [ -x /sbin/resolvconf ] ; then
 		# It gets run later (or, in the TIMEOUT case, MAY get run later)
 		make_resolv_conf() {
 			local R
-			local nameserver
+			local N
 			R=""
 			if [ "$new_domain_name_servers" ] && [ "$new_domain_name" ] ; then
 				R="${R}domain $new_domain_name
@@ -33,8 +33,8 @@ if [ -x /sbin/resolvconf ] ; then
 				R="${R}search $new_domain_search
 "
 			fi
-			for nameserver in $new_domain_name_servers ; do
-				R="${R}nameserver $nameserver
+			for N in $new_domain_name_servers ; do
+				R="${R}nameserver $N
 "
 			done
 			[ ! "$interface" ] || echo -n "$R" | /sbin/resolvconf -a "${interface}.dhclient"
@@ -45,27 +45,27 @@ if [ -x /sbin/resolvconf ] ; then
 		# It gets run later (or, in the TIMEOUT case, MAY get run later)
 		make_resolv_conf() {
 			local R
-			local nameserver
-			local zone_id
+			local N
+			local N_LOW
+			local ZONE_ID
 			R=""
 			if [ "$new_dhcp6_name_servers" ] && [ "$new_dhcp6_domain_search" ] ; then
 				R="${R}search $new_dhcp6_domain_search
 "
 			fi
-			shopt -s nocasematch
-			for nameserver in $new_dhcp6_name_servers ; do
+			for N in $new_dhcp6_name_servers ; do
 
 				# If the nameserver has a link-local address
 				# then add a zone ID (interface name) to it.
-				if  [[ "$nameserver" =~ ^fe80:: ]] ; then
-					zone_id="%$interface"
+				N_LOW="$(echo "$N" | tr '[:upper:]' '[:lower:]')"
+				if expr "$N_LOW" : ^fe80:: >/dev/null ; then
+					ZONE_ID="%$interface"
 				else
-					zone_id=""
+					ZONE_ID=""
 				fi
-				R="${R}nameserver $nameserver$zone_id
+				R="${R}nameserver $N$ZONE_ID
 "
 			done
-			shopt -u nocasematch
 			[ ! "$interface" ] || echo -n "$R" | /sbin/resolvconf -a "${interface}.ip6.dhclient"
 		}
 		;;

Attachment: resolvconf
Description: Binary data



Reply via email to