grml-terminalserver-config: use x.x.x.10 as starting IP address range
authorMichael Prokop <mika@grml.org>
Wed, 29 Sep 2010 16:20:17 +0000 (18:20 +0200)
committerChristian Hofstaedtler <ch@grml.org>
Tue, 6 Dec 2011 11:19:24 +0000 (12:19 +0100)
If we have x.x.x.1 as starting range adress provide x.x.x.10
instead so we avoid possible conflicts with default gateway.

grml-terminalserver-config

index 8aa0748..b14a7b6 100755 (executable)
@@ -167,6 +167,12 @@ for addresses from 192.168.0.101 to (and including) 192.168.0.200.
   done
 
   IPRANGE_FROM_=`execute "ipcalc -nb $IP_/$NETMASK_" warn |awk '/HostMin/{print $2}'`
+  # if we have x.x.x.1 as starting range adress provide
+  # x.x.x.10 instead so we avoid possible conflicts with
+  # default gateway
+  if echo $IPFROM | grep -c '\.1$' ; ; then
+    IPFROM="${IPFROM%%\.1}.10"
+  fi
   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_%/*}