From 5a8479cd850ee973e87dcfbc6cc8c0cbf5ff29d7 Mon Sep 17 00:00:00 2001 From: Arif Ali Date: Fri, 28 Mar 2014 11:05:37 +0000 Subject: [PATCH] update the routes for debian/ubuntu as well --- xCAT/postscripts/routeop | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/xCAT/postscripts/routeop b/xCAT/postscripts/routeop index c0297364f..545e436b0 100755 --- a/xCAT/postscripts/routeop +++ b/xCAT/postscripts/routeop @@ -240,8 +240,13 @@ add_persistent_route() echo " up route -A inet6 add $net/$mask gw $gw" >> $tempfile echo " down route -A inet6 del $net/$mask gw $gw" >> $tempfile else - echo " up route add -net $net netmask $mask gw $gw" >> $tempfile - echo " down route del -net $net netmask $mask gw $gw" >> $tempfile + if [ "$gw" = "" -o "$gw" = "0.0.0.0" ] ; then + echo " up route add -net $net netmask $mask dev $ifname" >> $tempfile + echo " down route del -net $net netmask $mask dev $ifname" >> $tempfile + else + echo " up route add -net $net netmask $mask gw $gw" >> $tempfile + echo " down route del -net $net netmask $mask gw $gw" >> $tempfile + fi fi fi echo $LINE | grep "iface $ifname " 2>&1 1>/dev/null @@ -258,8 +263,13 @@ add_persistent_route() echo " up route -A inet6 add $net/$mask gw $gw" >> $tempfile echo " down route -A inet6 del $net/$mask gw $gw" >> $tempfile else - echo " up route add -net $net netmask $mask gw $gw" >> $tempfile - echo " down route del -net $net netmask $mask gw $gw" >> $tempfile + if [ "$gw" = "" -o "$gw" = "0.0.0.0" ] ; then + echo " up route add -net $net netmask $mask dev $ifname" >> $tempfile + echo " down route del -net $net netmask $mask dev $ifname" >> $tempfile + else + echo " up route add -net $net netmask $mask gw $gw" >> $tempfile + echo " down route del -net $net netmask $mask gw $gw" >> $tempfile + fi fi fi mv -f $tempfile $filename