From patchwork Thu Dec 1 17:23:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 6250 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4NNNG81XPGz3xkp for ; Thu, 1 Dec 2022 17:23:44 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4NNNFs403Xz2w8; Thu, 1 Dec 2022 17:23:29 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4NNNFp2y5cz30CS; Thu, 1 Dec 2022 17:23:26 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4NNNFl2QFWz309M for ; Thu, 1 Dec 2022 17:23:23 +0000 (UTC) Received: from michael.haj.ipfire.org (michael.haj.ipfire.org [172.28.1.242]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "michael.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4NNNFl1TGpz2qD; Thu, 1 Dec 2022 17:23:23 +0000 (UTC) Received: by michael.haj.ipfire.org (Postfix, from userid 0) id 4NNNFl1CXlzTjnF; Thu, 1 Dec 2022 17:23:23 +0000 (UTC) From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 17/29] dhcpcd.exe: Use DNS servers from QMI Date: Thu, 1 Dec 2022 17:23:06 +0000 Message-Id: <20221201172318.3166615-17-michael.tremer@ipfire.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221201172318.3166615-1-michael.tremer@ipfire.org> References: <20221201172318.3166615-1-michael.tremer@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Tremer Errors-To: development-bounces@lists.ipfire.org Sender: "Development" 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/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 }