2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-30 17:46:38 +00:00

routeop: support setting the default route

This commit is contained in:
Kilian Cavalotti 2018-02-07 09:36:01 -08:00
parent ea9b20e1fe
commit 580c6bf5bd

View File

@ -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