From 3d9d58848197475b46980cb3207979d4207d84a0 Mon Sep 17 00:00:00 2001 From: Arne Fitzenreiter Date: Thu, 7 Feb 2013 20:23:01 +0100 Subject: [PATCH] network-skripts: fix gateway replace in /etc/hosts. --- src/initscripts/init.d/networking/dhcpcd.exe | 4 ++-- src/initscripts/init.d/networking/red | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/initscripts/init.d/networking/dhcpcd.exe b/src/initscripts/init.d/networking/dhcpcd.exe index d61c3d5f0..a7bad47b5 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 2b342c8a0..421c6f684 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 -- 2.39.2