From patchwork Tue Aug 29 08:52:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonatan Schlag X-Patchwork-Id: 7129 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 (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4RZh5r4LDSz3wtK for ; Tue, 29 Aug 2023 08:53:04 +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 (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4RZh5q1JZJz3qv; Tue, 29 Aug 2023 08:53:03 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4RZh5p6wnSz306n; Tue, 29 Aug 2023 08:53:02 +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 4RZh5n3G82z2xc7 for ; Tue, 29 Aug 2023 08:53:01 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4RZh5n1gTyz3sV; Tue, 29 Aug 2023 08:53:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1693299181; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vnvqapTz31gsbxy3xYqJzpsmunPIx3r2JJ4qpwKys5A=; b=KhYKX2WcMT2qMUyxGpQEjQm/gDIw67Vbrcsu5UaDuMcSq86+GTAndfnIwIsb9ZlajTfPhu 4Yhu0ei1tzLQ8ygAAnJTVt7CSbrP2QrsfoCzHiXwiGUmHkk6FBcSBKA4uJ2qnVS646nE1o yuSjpUZ4TBKfVWDzBAa/Ngx+imJhT17jjdKFyHEtCUfviBvZz5hfX7Rt6is0LUc6WVzq/Q v4evsDWYju0khd12XGwzLYH969o0ZkbwDQnikXNTQuaM8YUA6ErGGQRNBFR6ZVzQAcbKJJ bKEppmF67N05MeavTg7l3Jc80PV0cTGOqxZuJUEFcehzPL+7UsxaiTg34B8YDA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1693299181; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vnvqapTz31gsbxy3xYqJzpsmunPIx3r2JJ4qpwKys5A=; b=iF2/UemON2I4qePxcfwX1i2fPUlpLh4m0mLUntmYbBSAgcPMoHPtkBjJ/na1AIukdXB678 XTkaeNDfb4EoBZCA== From: Jonatan Schlag To: development@lists.ipfire.org Subject: [PATCH 5/5] network startup: Always cleanup before red gets started Date: Tue, 29 Aug 2023 10:52:41 +0200 Message-Id: <20230829085241.6985-5-jonatan.schlag@ipfire.org> In-Reply-To: <20230829085241.6985-1-jonatan.schlag@ipfire.org> References: <20230829085241.6985-1-jonatan.schlag@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: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" There is no sense in doing this only in /etc/init.d/network and not in /etc/init.d/networking/red This files should be always deleted before a startup Signed-off-by: Jonatan Schlag --- src/initscripts/networking/red | 3 +++ src/initscripts/system/network | 6 +----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/initscripts/networking/red b/src/initscripts/networking/red index 9da3ea406..beb665e5f 100644 --- a/src/initscripts/networking/red +++ b/src/initscripts/networking/red @@ -80,6 +80,9 @@ fi case "${1}" in start) + # Remove possible leftover files + rm -f /var/ipfire/red/{active,device,dial-on-demand,dns1,dns2,local-ipaddress,remote-ipaddress,resolv.conf} + if [ "${DEVICE}" != "${GREEN_DEV}" ] && [ "${DEVICE}" != "" ]; then boot_mesg "Bringing up the ${DEVICE} interface..." boot_mesg_flush diff --git a/src/initscripts/system/network b/src/initscripts/system/network index b38c3836c..0dcce060f 100644 --- a/src/initscripts/system/network +++ b/src/initscripts/system/network @@ -62,11 +62,7 @@ case "${DO}" in /etc/rc.d/init.d/networking/orange start # RED - if [ "$red" == "1" ]; then - # Remove possible leftover files - rm -f /var/ipfire/red/{active,device,dial-on-demand,dns1,dns2,local-ipaddress,remote-ipaddress,resolv.conf} - /etc/rc.d/init.d/networking/red start - fi + [ "$red" == "1" ] && /etc/rc.d/init.d/networking/red start # Create IPsec interfaces /usr/local/bin/ipsec-interfaces