]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
dhcpcd.exe: Do not overwrite the default gateway when empty
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 1 Dec 2022 17:23:07 +0000 (17:23 +0000)
committerPeter Müller <peter.mueller@ipfire.org>
Sat, 17 Dec 2022 17:20:46 +0000 (17:20 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/initscripts/networking/dhcpcd.exe

index acd083b6f186e37159a8bdd83525f730c26fa5a7..b85a2c5987df2f8e516df89c39621e3c4693993a 100644 (file)
@@ -63,7 +63,11 @@ dhcpcd_up()
 
        if [ $update ]; then
                [ -e "/var/ipfire/red/active" ] || touch /var/ipfire/red/active
-               echo -n "$new_routers" > /var/ipfire/red/remote-ipaddress
+
+               if [ -n "${new_routers}" ]; then
+                       echo -n "${new_routers}" > /var/ipfire/red/remote-ipaddress
+               fi
+
                logger -p local0.info -t dhcpcd.exe[$$] "$interface has been (re)configured with IP=$new_ip_address"
                run_subdir ${rc_base}/init.d/networking/red.up/
                touch /var/ipfire/red/active