mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-23 09:22:59 +02:00
network-skripts: fix gateway replace in /etc/hosts.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user