for i in `ls ifcfg-eth1-range*`;
do
. ./$i
D1=`echo $IPADDR_START|cut -d. -f4`;
D2=`echo $IPADDR_END|cut -d. -f4`;
D=`expr $D2 - $D1`;
echo $D;
S=`echo $IPADDR_START|cut -d. -f1,2,3`;
for j in `seq 0 $D`;
do
echo "DEVICE=eth1:`expr $j + $CLONENUM_START`
BOOTPROTO=static
ONBOOT=yes
IPADDR=$S.`expr $D1 + $j`
NETMASK=$NETMASK" > ifcfg-eth1:`expr $j + $CLONENUM_START`;
done
done
Wednesday, March 4, 2009
Quick shell script to convert ifcfg-ethX-rangeY to ifcfg-ethX:Y format
Quick shell script to convert ifcfg-ethX-rangeY to ifcfg-ethX:Y format:
Subscribe to:
Post Comments (Atom)





0 comments:
Post a Comment