Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- src/initscripts/networking/dhcpcd.exe | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
diff --git a/src/initscripts/networking/dhcpcd.exe b/src/initscripts/networking/dhcpcd.exe index fe64132c8..acd083b6f 100644 --- a/src/initscripts/networking/dhcpcd.exe +++ b/src/initscripts/networking/dhcpcd.exe @@ -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 }