]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/commitdiff
network-skripts: fix gateway replace in /etc/hosts.
authorArne Fitzenreiter <arne_f@ipfire.org>
Thu, 7 Feb 2013 19:23:01 +0000 (20:23 +0100)
committerArne Fitzenreiter <arne_f@ipfire.org>
Thu, 7 Feb 2013 19:23:01 +0000 (20:23 +0100)
src/initscripts/init.d/networking/dhcpcd.exe
src/initscripts/init.d/networking/red

index d61c3d5f0243d9551883c8c302334df5af480c23..a7bad47b5037c0af2ef4af5551940ef21a51b6f0 100644 (file)
@@ -64,8 +64,8 @@ dhcpcd_up()
                echo -n "$new_ip_address"  > /var/ipfire/red/local-ipaddress
 
                #Get default gateway
-               grep -v " gateway$" /etc/hosts > /tmp/hosts
-               echo "$new_routers gateway"  >> /tmp/hosts
+               grep -v -E "\<gateway\>" /etc/hosts > /tmp/hosts
+               echo "$new_routers      gateway"  >> /tmp/hosts
                mv /tmp/hosts /etc/hosts
 
        fi
index 2b342c8a0334428f09b2283b5f993c69a36dcb13..421c6f68421da9b826dea3e96f21108610ce62cb 100644 (file)
@@ -120,8 +120,8 @@ case "${1}" in
                        echo -n "${DEVICE}" > /var/ipfire/red/iface
                        echo -n "${ADDRESS}"  > /var/ipfire/red/local-ipaddress
                        echo -n "${GATEWAY}" > /var/ipfire/red/remote-ipaddress
-                       grep -v "gateway" /etc/hosts > /tmp/hosts
-                       echo "$GATEWAY gateway"  >> /tmp/hosts
+                       grep -v -E "\<gateway\>" /etc/hosts > /tmp/hosts
+                       echo "$GATEWAY  gateway"  >> /tmp/hosts
                        mv /tmp/hosts /etc/hosts
                        echo -n "${DNS1}" > /var/ipfire/red/dns1
                        echo -n "${DNS2}" > /var/ipfire/red/dns2