[debian-lan-devel] [SCM] Debian-LAN development and packaging branch, master, updated. dbdf4717096be75350efc43d7c88d14bddef33bc

Andreas B. Mundt andi.mundt at web.de
Mon Jan 30 20:24:21 UTC 2012


The following commit has been merged in the master branch:
commit dbdf4717096be75350efc43d7c88d14bddef33bc
Author: Andreas B. Mundt <andi.mundt at web.de>
Date:   Sun Jan 29 22:29:03 2012 +0100

    Improve adding HW addresses to dhcp.conf.

diff --git a/fai/config/files/usr/sbin/debian-lan/SERVER_A b/fai/config/files/usr/sbin/debian-lan/SERVER_A
index c5b13f5..4055eb1 100755
--- a/fai/config/files/usr/sbin/debian-lan/SERVER_A
+++ b/fai/config/files/usr/sbin/debian-lan/SERVER_A
@@ -188,15 +188,20 @@ EOF
 	allHW=`grep -o "\w\{2\}:\w\{2\}:\w\{2\}:\w\{2\}:\w\{2\}:\w\{2\}" /var/log/syslog | sort -u`
 	for HWaddr in $allHW ; do
 	    if echo $locHW | grep -q $HWaddr ; then
-		echo "Skipping local MAC address: ${HWaddr}."
+		echo "Skipping local MAC address: ${HWaddr}"
 		continue
 	    elif grep -q $HWaddr $DHCPCONF; then
-		echo "Foreign MAC address $HWaddr already found in '${DHCPCONF}'."
+		echo "MAC address $HWaddr already in ${DHCPCONF}"
 	    else
-		sed -i "0,/\(host ${NAME}.*\) A1:B2:C3:D4:E5:\w\{2\};/s//\1 ${HWaddr};/" ${DHCPCONF}
-		echo "Adding foreign MAC address $HWaddr to '${DHCPCONF}'."
+		read -e -n 1 -p "Add ${HWaddr} to ${DHCPCONF} [Y|n]?  " inp
+		inp=${inp:-Y}
+		if [ $inp = "Y" ] || [ $inp = "y" ] ; then
+		    sed -i "0,/\(host ${NAME}.*\) A1:B2:C3:D4:E5:\w\{2\};/s//\1 ${HWaddr};/" ${DHCPCONF}
+		    echo "MAC address $HWaddr added."
+		fi
 	    fi
 	done
+	/etc/init.d/isc-dhcp-server restart
 	;;
     
     *)

-- 
Debian-LAN development and packaging



More information about the debian-lan-devel mailing list