From 3a3568d1cc0ee75c9d682c1d1792dbcf212340da Mon Sep 17 00:00:00 2001 From: daniceexi Date: Mon, 30 Jun 2014 04:21:10 -0400 Subject: [PATCH] Change the default operator of setroute script to be replace from add. If you want to use add, run it as [setroute add] --- xCAT/postscripts/setroute | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) 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