mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-07-24 13:21:12 +00:00
routeop: support setting the default route
This commit is contained in:
@@ -269,7 +269,7 @@ replace_persistent_route()
|
||||
|
||||
redhat)
|
||||
#echo "rh/fedora/centos"
|
||||
if [ -z "$ifname" ]; then
|
||||
if [ -z "$ifname" -a "$net" != "default" ]; then
|
||||
echo "Error: the device name is necessary to configure static route."
|
||||
return
|
||||
fi
|
||||
@@ -296,6 +296,12 @@ replace_persistent_route()
|
||||
route1="$net\/$mask via $gw"
|
||||
fi
|
||||
fi
|
||||
# default route is handled separately
|
||||
if [ "$net" = "default" ]; then
|
||||
filename="/etc/sysconfig/network"
|
||||
route="GATEWAY=$gw"
|
||||
routedest="$route"
|
||||
fi
|
||||
if [ -f $filename ]; then
|
||||
egrep "^$routedest" $filename 2>&1 1>/dev/null
|
||||
if [ $? -ne 0 ]; then #route does not exist
|
||||
|
Reference in New Issue
Block a user