]> git.ipfire.org Git - people/ms/ipfire-2.x.git/commitdiff
dhcpcd.exe: Allow using the DHCP setup scripts when RED is not configured as DHCP
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 7 Sep 2022 15:52:55 +0000 (17:52 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 1 Dec 2022 17:10:25 +0000 (17:10 +0000)
This is useful for dial-up methods that use DHCP, but when RED_TYPE is
configured as PPP.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/initscripts/networking/dhcpcd.exe

index 38632aa613e9da2781419dfd16ea06fa4ccb20d4..8a409d0109c1c701c7d4bfe5ea70be9fe8a62395 100644 (file)
@@ -34,32 +34,30 @@ dhcpcd_up()
        fi
 
        # Only if RED_TYPE=DHCP update /var/ipfire/red
-       if [ "$RED_TYPE" == "DHCP" ]; then
-               # Check if we have to restart the services at update
-               [ ! -e "/var/ipfire/red/active" ] && update=1;
-               if [ "$old_domain_name_service" != "$new_domain_name_service" ]; then
-                       update=1;
-               fi
-               if [ "$old_ip_address" != "$new_ip_address" ]; then
-                       update=1;
-               fi
-               if [ "$old_routers" != "$new_routers" ]; then
-                       update=1;
-               fi
+       # Check if we have to restart the services at update
+       [ ! -e "/var/ipfire/red/active" ] && update=1;
+       if [ "$old_domain_name_service" != "$new_domain_name_service" ]; then
+               update=1;
+       fi
+       if [ "$old_ip_address" != "$new_ip_address" ]; then
+               update=1;
+       fi
+       if [ "$old_routers" != "$new_routers" ]; then
+               update=1;
+       fi
 
-               # Get DNS from dhcp
-               /etc/rc.d/helper/getdnsfromdhcpc.pl 1 > /var/run/dns1
-               /etc/rc.d/helper/getdnsfromdhcpc.pl 2 > /var/run/dns2
+       # Get DNS from dhcp
+       /etc/rc.d/helper/getdnsfromdhcpc.pl 1 > /var/run/dns1
+       /etc/rc.d/helper/getdnsfromdhcpc.pl 2 > /var/run/dns2
 
-               #Get IP Address
-               echo -n "$new_ip_address"  > /var/ipfire/red/local-ipaddress
+       #Get IP Address
+       echo -n "$new_ip_address"  > /var/ipfire/red/local-ipaddress
 
-               #Get default gateway
-               grep -v -E "\<gateway\>" /etc/hosts > /tmp/hosts
-               echo "$new_routers      gateway"  >> /tmp/hosts
-               mv /tmp/hosts /etc/hosts
+       #Get default gateway
+       grep -v -E "\<gateway\>" /etc/hosts > /tmp/hosts
+       echo "$new_routers      gateway"  >> /tmp/hosts
+       mv /tmp/hosts /etc/hosts
 
-       fi
        if [ $update ]; then
                [ -e "/var/ipfire/red/active" ] || touch /var/ipfire/red/active
                echo -n "$new_routers" > /var/ipfire/red/remote-ipaddress