From 38520e623a2dcbf60a39f1b201f9a0bb0739c66d Mon Sep 17 00:00:00 2001 From: Michael Gebetsroither Date: Sat, 19 Nov 2005 10:53:58 +0100 Subject: [PATCH] fixed bug in dhcp config template and fales NETWORK calculation --- debian/changelog | 8 ++++++++ grml-terminalserver-config | 9 +++++---- templates/dhcpd_config | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 831fb36..b23de61 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Sat, 19 Nov 2005 10:51:23 +0100 + grml-terminalserver (0.67) unstable; urgency=low * changed dependency to grml-shlib diff --git a/grml-terminalserver-config b/grml-terminalserver-config index 9369465..0724675 100755 --- a/grml-terminalserver-config +++ b/grml-terminalserver-config @@ -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_" diff --git a/templates/dhcpd_config b/templates/dhcpd_config index 56badbc..34fe065 100644 --- a/templates/dhcpd_config +++ b/templates/dhcpd_config @@ -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"; } -- 2.1.4