Sunday, April 13, 2008

Solaris/AIX Saving routing table before reboot

To capture routes
# ls
add_all_routes capture.sh
root@nstgdb2:/tmp/imran # more capture.sh
#! /bin/sh
netstat -rn |egrep -v "127.0.0.1|-|Routing|Destination" | awk '{ print $1"\t "$2
}'|cut -d"%" -f1 >routes
awk '{ print "route add ", $1,$2 }' routes >add_all_routes
#
To restore routes just run
#sh all_all_routes

No comments:

UNIX: How to print column nicely using printf

[user@hostfwnms1-oam tmp]# cat b.sh printf "%-26s %-19s %-8s %-8s %-s %-s\n" HOSTNAME IP PING SNMPWALK 0-ok 1-fail for i in `cat n...