[pkg-dhcp-commits] [SCM] ISC DHCP packaging for Debian branch, master, updated. debian/4.1.1-P1-16.1-14-g02638d8

Andrew Pollock apollock at debian.org
Thu May 19 05:53:11 UTC 2011


The following commit has been merged in the master branch:
commit 36d82b29a3197ba77754bd01d7579cd84362820e
Author: Peter Marschall <peter at adpm.de>
Date:   Sat Jan 8 16:30:08 2011 +0100

    debug-*: show more complete list of DHCP variables
    
    Show many more variables:
    * all prefixes: cur_, new_, old_  & empty prefix as a trick for un-prefixed vars
    * include DHCPv6 related variables
    
    Signed-off-by: Peter Marschall <peter at adpm.de>

diff --git a/debian/debug-enter b/debian/debug-enter
index 26564f5..2bdd5fd 100644
--- a/debian/debug-enter
+++ b/debian/debug-enter
@@ -13,14 +13,24 @@ if [ "$RUN" = "yes" ]; then
 	echo `date`: entering dhclient-enter-hooks.d, dumping variables. \
 		>> /tmp/dhclient-script.debug
 
-	for i in reason interface medium alias_ip_address new_ip_address \
-		new_subnet_mask new_domain_name new_domain_search \
-		new_domain_name_servers \
-		new_routers new_static_routes old_ip_address old_subnet_mask \
-		old_domain_name old_domain_search old_domain_name_servers \
-		old_routers old_static_routes; do
+	# loop over the 4 possible prefixes: (empty), cur_, new_, old_
+	for prefix in '' 'cur_' 'new_' 'old_'; do
+		# loop over the DHCP variables passed to dhclient-script
+		for basevar in reason interface medium alias_ip_address \
+			       ip_address host_name network_number subnet_mask \
+			       broadcast_address routers static_routes \
+			       rfc3442_classless_static_routes \
+			       domain_name domain_search domain_name_servers \
+			       netbios_name_servers netbios_scope \
+			       ntp_servers \
+			       ip6_address ip6_prefix ip6_prefixlen \
+			       dhcp6_domain_search dhcp6_name_servers ; do
+			var="${prefix}${basevar}"
 
-		echo $i=\'${!i}\' >> /tmp/dhclient-script.debug
+			if [ -n "${!var}" ]; then
+				echo "$var='${!var}'" >> /tmp/dhclient-script.debug
+			fi
+		done
 	done
 
 	echo '--------------------------' >> /tmp/dhclient-script.debug
diff --git a/debian/debug-exit b/debian/debug-exit
index 9173ac5..e16d204 100644
--- a/debian/debug-exit
+++ b/debian/debug-exit
@@ -13,13 +13,24 @@ if [ "$RUN" = "yes" ]; then
 	echo `date`: entering dhclient-exit-hooks.d, dumping variables. \
 		>> /tmp/dhclient-script.debug
 
-	for i in reason interface medium alias_ip_address new_ip_address \
-			new_subnet_mask new_domain_name new_domain_search \
-			new_domain_name_servers new_routers new_static_routes \
-			old_ip_address old_subnet_mask old_domain_name \
-			old_domain_search old_domain_name_servers old_routers \
-			old_static_routes; do
-		echo $i=\'${!i}\' >> /tmp/dhclient-script.debug
+	# loop over the 4 possible prefixes: (empty), cur_, new_, old_
+	for prefix in '' 'cur_' 'new_' 'old_'; do
+		# loop over the DHCP variables passed to dhclient-script
+		for basevar in reason interface medium alias_ip_address \
+			       ip_address host_name network_number subnet_mask \
+			       broadcast_address routers static_routes \
+			       rfc3442_classless_static_routes \
+			       domain_name domain_search domain_name_servers \
+			       netbios_name_servers netbios_scope \
+			       ntp_servers \
+			       ip6_address ip6_prefix ip6_prefixlen \
+			       dhcp6_domain_search dhcp6_name_servers ; do
+			var="${prefix}${basevar}"
+
+			if [ -n "${!var}" ]; then
+				echo "$var='${!var}'" >> /tmp/dhclient-script.debug
+			fi
+		done
 	done
 
 	echo '--------------------------' >> /tmp/dhclient-script.debug

-- 
ISC DHCP packaging for Debian



More information about the pkg-dhcp-commits mailing list