aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Labastie <pierre.labastie@neuf.fr>2022-03-23 10:03:34 +0100
committerPierre Labastie <pierre.labastie@neuf.fr>2022-03-25 10:52:34 +0100
commited6ffcb2e2b4a72f8dcbe500b6887de8fa8dd361 (patch)
tree7c7e035e75b0bbd67675a655b939912b2e1c589b
parent253925339919fbf3b4085889c59241bf7aad96e6 (diff)
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.
-rw-r--r--bootscripts/lfs/init.d/network2
1 files changed, 2 insertions, 0 deletions
diff --git a/bootscripts/lfs/init.d/network b/bootscripts/lfs/init.d/network
index 91c52e085..5b2dd9b97 100644
--- a/bootscripts/lfs/init.d/network
+++ b/bootscripts/lfs/init.d/network
@@ -29,6 +29,8 @@
case "${1}" in
start)
+ # if the default route exists, network is already configured
+ if ip route | grep -q "^default"; then return 0; fi
# Start all network interfaces
for file in /etc/sysconfig/ifconfig.*
do