network-skripts: fix gateway replace in /etc/hosts.

This commit is contained in:
Arne Fitzenreiter
2013-02-07 20:23:01 +01:00
parent 6f704a3c85
commit 3d9d588481
2 changed files with 4 additions and 4 deletions

View 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

View 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