fixed bug in dhcp config template and fales NETWORK calculation
authorMichael Gebetsroither <michael.geb@gmx.at>
Sat, 19 Nov 2005 09:53:58 +0000 (10:53 +0100)
committerMichael Gebetsroither <michael.geb@gmx.at>
Sat, 19 Nov 2005 09:53:58 +0000 (10:53 +0100)
debian/changelog
grml-terminalserver-config
templates/dhcpd_config

index 831fb36..b23de61 100644 (file)
@@ -1,3 +1,11 @@
+grml-terminalserver (0.68) unstable; urgency=low
+
+  * fixed bug in dhcp-config template
+  * fixed bug with false NETWORK_
+  * changed configfile layout (still fully compatibel to older versions)
+
+ -- Michael Gebetsroither <michael.geb@gmx.at>  Sat, 19 Nov 2005 10:51:23 +0100
+
 grml-terminalserver (0.67) unstable; urgency=low
 
   * changed dependency to grml-shlib 
index 9369465..0724675 100755 (executable)
@@ -85,12 +85,12 @@ function writeConfig
 # created on "$date_"
 INTERFACE_="$INTERFACE_"
 IP_="$IP_"
+NETWORK_="$NETWORK_"
 NETMASK_="$NETMASK_"
 GW_="$GW_"
 NAMESERVERS_="$NAMESERVERS_"
 IPRANGE_FROM_="$IPRANGE_FROM_"
 IPRANGE_TO_="$IPRANGE_TO_"
-NETWORK_="$NETWORK_"
 OPTIONS_="$OPTIONS_"
 BOOT_ARGS_="$BOOT_ARGS_"
 
@@ -290,9 +290,10 @@ for addresses from 192.168.0.101 to (and including) 192.168.0.200.
       netcardconfig || die "Could not get interface" $?
   done
 
-  IPRANGE_FROM_=`execute "ipcalc -n $IP_/$NETMASK_" warn |awk '/HostMin/{print $2}'`
-  IPRANGE_TO_=`execute "ipcalc -n $IP_/$NETMASK_" warn |awk '/HostMax/{print $2}'`
-  NETWORK_=$IPRANGE_FROM_
+  IPRANGE_FROM_=`execute "ipcalc -nb $IP_/$NETMASK_" warn |awk '/HostMin/{print $2}'`
+  IPRANGE_TO_=`execute "ipcalc -nb $IP_/$NETMASK_" warn |awk '/HostMax/{print $2}'`
+  NETWORK_=`execute "ipcalc -nb $IP_/$NETMASK_" warn |awk '/Network:/{print $2}'`
+  NETWORK_=${NETWORK_%/*}
   local iprange_=""
   while [ -z "$IPRANGE_FROM_" -o -z "$IPRANGE_TO_" -o -z "$iprange_" ]; do
     iprange_="$IPRANGE_FROM_ $IPRANGE_TO_"
index 56badbc..34fe065 100644 (file)
@@ -37,7 +37,7 @@ allow bootp;
 default-lease-time 600;
 max-lease-time 7200;
 
-subnet ${IP_%.*}.0 netmask $NETMASK_ {
+subnet $NETWORK_ netmask $NETMASK_ {
   next-server $IP_;
   if substring (option vendor-class-identifier, 0, 9) = "Etherboot" { filename "etherboot.nbi"; }
   else { filename "pxelinux.0"; }