Script must be placed in '/etc/dhcp3/dhclient-exit-hooks.d/'
(for example: /etc/dhcp3/dhclient-exit-hooks.d/configu
Was tested in Ubuntu 8.04.1
#!/bin/sh
function process_routes() {
while [ $# -gt 1 ]
do
dest=$1
gateway=$2
shift; shift
route add $dest gw $gateway
done
}
if [ "$reason" = "BOUND" ] || [ "$reason" = "REBOOT" ]
then
echo "static_routes = $new_static_routes"
process_routes $new_static_routes
fi