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