mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 10:35:53 +02:00
dhcpcd.exe: Use DNS servers from QMI
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
committed by
Peter Müller
parent
261727435d
commit
ccf36e9e8c
@@ -111,6 +111,8 @@ setup_qmi() {
|
||||
local netmask
|
||||
local gateway
|
||||
local mtu=1500
|
||||
local dns1
|
||||
local dns2
|
||||
|
||||
local line
|
||||
while read -r line; do
|
||||
@@ -127,6 +129,12 @@ setup_qmi() {
|
||||
*IPv4\ gateway\ address:*)
|
||||
gateway="${value}"
|
||||
;;
|
||||
*IPv4\ primary\ DNS:*)
|
||||
dns1="${value}"
|
||||
;;
|
||||
*IPv4\ secondary\ DNS:*)
|
||||
dns2="${value}"
|
||||
;;
|
||||
*MTU:*)
|
||||
mtu="${value}"
|
||||
;;
|
||||
@@ -154,6 +162,14 @@ setup_qmi() {
|
||||
ip route add default via "${gateway}" mtu "${mtu}"
|
||||
fi
|
||||
|
||||
# Store and DNS servers
|
||||
if [ -n "${dns1}" ]; then
|
||||
echo -n "${dns1}" > /var/ipfire/red/dns1
|
||||
fi
|
||||
if [ -n "${dns2}" ]; then
|
||||
echo n "${dns2}" > /var/ipfire/red/dns2
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user