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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s