network bootscript: Don't run ifup if route already set

Otherwise, warnings are issued when changing runlevel. "ip route"
is a good test of whether network is already up. If users want to
change some config, they should use ifup/down, not the network
bootscript.
This commit is contained in:
Pierre Labastie 2022-03-23 10:03:34 +01:00
parent 2539253399
commit ed6ffcb2e2

View File

@ -29,6 +29,8 @@
case "${1}" in case "${1}" in
start) start)
# if the default route exists, network is already configured
if ip route | grep -q "^default"; then return 0; fi
# Start all network interfaces # Start all network interfaces
for file in /etc/sysconfig/ifconfig.* for file in /etc/sysconfig/ifconfig.*
do do