From: Arne Fitzenreiter Date: Thu, 7 Feb 2013 19:23:01 +0000 (+0100) Subject: network-skripts: fix gateway replace in /etc/hosts. X-Git-Tag: v2.13-rc2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3d9d58848197475b46980cb3207979d4207d84a0;p=people%2Fms%2Fipfire-2.x.git network-skripts: fix gateway replace in /etc/hosts. --- diff --git a/src/initscripts/init.d/networking/dhcpcd.exe b/src/initscripts/init.d/networking/dhcpcd.exe index d61c3d5f02..a7bad47b50 100644 --- a/src/initscripts/init.d/networking/dhcpcd.exe +++ b/src/initscripts/init.d/networking/dhcpcd.exe @@ -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 "\" /etc/hosts > /tmp/hosts + echo "$new_routers gateway" >> /tmp/hosts mv /tmp/hosts /etc/hosts fi diff --git a/src/initscripts/init.d/networking/red b/src/initscripts/init.d/networking/red index 2b342c8a03..421c6f6842 100644 --- a/src/initscripts/init.d/networking/red +++ b/src/initscripts/init.d/networking/red @@ -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 "\" /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