mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
dhcpcd.exe: Only set gateway when we have received one
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
committed by
Peter Müller
parent
11f6226f65
commit
36914cce70
@@ -54,10 +54,12 @@ dhcpcd_up()
|
|||||||
#Get IP Address
|
#Get IP Address
|
||||||
echo -n "$new_ip_address" > /var/ipfire/red/local-ipaddress
|
echo -n "$new_ip_address" > /var/ipfire/red/local-ipaddress
|
||||||
|
|
||||||
#Get default gateway
|
# Get default gateway
|
||||||
grep -v -E "\<gateway\>" /etc/hosts > /tmp/hosts
|
if [ -n "${new_routers}" ]; then
|
||||||
echo "$new_routers gateway" >> /tmp/hosts
|
grep -v -E "\<gateway\>" /etc/hosts > /tmp/hosts
|
||||||
mv /tmp/hosts /etc/hosts
|
echo "$new_routers gateway" >> /tmp/hosts
|
||||||
|
mv /tmp/hosts /etc/hosts
|
||||||
|
fi
|
||||||
|
|
||||||
if [ $update ]; then
|
if [ $update ]; then
|
||||||
[ -e "/var/ipfire/red/active" ] || touch /var/ipfire/red/active
|
[ -e "/var/ipfire/red/active" ] || touch /var/ipfire/red/active
|
||||||
|
|||||||
Reference in New Issue
Block a user