This repository was archived by the owner on Jan 16, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -99,6 +99,7 @@ if [ -d /etc/sysconfig/network-scripts ]; then
9999 # Prepare network files
100100 find /etc/sysconfig/network-scripts -type f \
101101 -name ' ifcfg-*' ! -name ' ifcfg-lo' \
102+ -o -name ' route-*' ! -name ' route-lo' \
102103 -exec rm -f {} \;
103104
104105 if [ " ${NETWORK_EC2} " = ' yes' ]; then
Original file line number Diff line number Diff line change @@ -108,13 +108,11 @@ EOT
108108
109109 if [ -n " $GATEWAY " ]; then
110110 if [ " $CONFIG_PATH " = " /etc/sysconfig/network" ]; then
111- echo " default $GATEWAY - $DEV " ${METRIC: +metric ${METRIC} } >> /etc/sysconfig/network/ifroute-$DEV
111+ echo " default $GATEWAY - $DEV ${METRIC: +metric ${METRIC} } " \
112+ >> " ${CONFIG_PATH} /ifroute-${DEV} "
112113 else
113- echo " GATEWAY=$GATEWAY "
114-
115- if [ -n " $METRIC " ]; then
116- echo " METRIC=$METRIC "
117- fi
114+ echo " default via $GATEWAY dev $DEV ${METRIC: +metric ${METRIC} } " \
115+ >> " ${CONFIG_PATH} /route-${DEV} "
118116 fi
119117 fi
120118
@@ -244,6 +242,7 @@ gen_network_configuration()
244242 [ -z " ${DEV} " ] && continue
245243
246244 (
245+ rm -f /etc/sysconfig/network-scripts/route-$DEV
247246 rm -f /etc/sysconfig/network/ifroute-$DEV
248247 rm -f /etc/sysconfig/network/ifsysctl-$DEV
249248
Original file line number Diff line number Diff line change @@ -93,9 +93,9 @@ for pci in $PCI_INTERFACES; do
9393 if [ -n " $IP " ]; then
9494 ip address add $IP /$MASK dev $DEV
9595
96- if [ -n " $GATEWAY " ]; then
97- ip route add default via $GATEWAY dev $DEV ${METRIC: +metric ${METRIC} }
98- fi
96+ if [ -n " $GATEWAY " ]; then
97+ ip route add default via $GATEWAY dev $DEV ${METRIC: +metric ${METRIC} }
98+ fi
9999 fi
100100
101101 # IPv6
You can’t perform that action at this time.
0 commit comments