From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 17/29] dhcpcd.exe: Use DNS servers from QMI Date: Thu, 01 Dec 2022 17:23:06 +0000 Message-ID: <20221201172318.3166615-17-michael.tremer@ipfire.org> In-Reply-To: <20221201172318.3166615-1-michael.tremer@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2569844342376850674==" List-Id: --===============2569844342376850674== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Signed-off-by: Michael Tremer --- src/initscripts/networking/dhcpcd.exe | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/initscripts/networking/dhcpcd.exe b/src/initscripts/networki= ng/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=3D1500 + local dns1 + local dns2 =20 local line while read -r line; do @@ -127,6 +129,12 @@ setup_qmi() { *IPv4\ gateway\ address:*) gateway=3D"${value}" ;; + *IPv4\ primary\ DNS:*) + dns1=3D"${value}" + ;; + *IPv4\ secondary\ DNS:*) + dns2=3D"${value}" + ;; *MTU:*) mtu=3D"${value}" ;; @@ -154,6 +162,14 @@ setup_qmi() { ip route add default via "${gateway}" mtu "${mtu}" fi =20 + # 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 } =20 --=20 2.30.2 --===============2569844342376850674==--