diff --git a/xCAT/postscripts/setroute b/xCAT/postscripts/setroute index 2385a6a00..09d904263 100755 --- a/xCAT/postscripts/setroute +++ b/xCAT/postscripts/setroute @@ -2,8 +2,11 @@ # IBM(c) 2011 EPL license http://www.eclipse.org/legal/epl-v10.html #------------------------------------------------------------------------------- -#=head1 setroute -#=head2 setrout command adds the routes to the node according to +#=head1 setroute [add] +# [add] - The operation to manipulate the route entry. It is optional. +# The default is 'replace' if ignoring it. +# +#=head2 setrout command replaces/adds the routes to the node according to # what is specified in the xCAT tables. # The route name for the node is defined in noderes.routenames. # The route itself is defined in the routes table. @@ -14,6 +17,12 @@ if [ -z "$NODEROUTENAMES" ]; then exit 0 fi +OP="replace" + +if [ -n "$1" ] && [ "$1" = "add" ]; then + OP="add" +fi + for rn in `echo "$NODEROUTENAMES" | tr "," "\n"` do eval route_string=\$ROUTE_$rn @@ -34,7 +43,7 @@ do mask=`echo $mask | awk -F'/' '{print $2}'` fi - cmd="routeop add $net $mask $gw $ifname" + cmd="routeop $OP $net $mask $gw $ifname" result=`$cmd 2>&1` echo $result done