#!/bin/bash
if [ $# != 3 ];then
echo "Usage: $0 ad_name st_num end_num"
exit 1
fi
for i in `seq $2 $3`
do
ipfile='/etc/sysconfig/network-scripts/ifcfg-'$1
ipfile_2=$ipfile":$i"
cp $ipfile $ipfile_2
sed -i "s/^DEVICE.*/DEVICE=$1:$i/g" $ipfile_2
sed -i "s/^IPADDR.*/IPADDR=10.10.10.$i/g" $ipfile_2
done
11-05