]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/initscripts/init.d/networking/dhcpcd.exe
network-skripts: fix gateway replace in /etc/hosts.
[people/pmueller/ipfire-2.x.git] / src / initscripts / init.d / networking / dhcpcd.exe
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