Tag Archives: centos

CentOS routes batch file creation

create_permanent_routes.sh

CNT=8; for i in `cat listado`; do sed "s/Z/$i/g;s/X/$CNT/g" template && let CNT++; done 

listado:

172.16.170.0
172.16.145.0
172.16.130.0
172.16.140.0
172.16.160.0
172.16.135.0
172.16.155.0
172.16.165.0

template:

ADDRESSX=Z
GATEWAYX=172.16.32.7
NETMASKX=255.255.255.0
Advertisements