public inbox for ipfire-scm@lists.ipfire.org
 help / color / mirror / Atom feed
From: Arne Fitzenreiter <git@ipfire.org>
To: ipfire-scm@lists.ipfire.org
Subject: [git.ipfire.org] IPFire 2.x development tree branch, next, updated. 15e34194346674213e2cff30828f6f764311a685
Date: Tue, 28 Jan 2020 21:47:54 +0000	[thread overview]
Message-ID: <486gG25gtFz30hP@people01.haj.ipfire.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 2644 bytes --]

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPFire 2.x development tree".

The branch, next has been updated
       via  15e34194346674213e2cff30828f6f764311a685 (commit)
      from  3ee6ac9dad4896e624d4776409e6a07e335e0e55 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 15e34194346674213e2cff30828f6f764311a685
Author: Arne Fitzenreiter <arne_f(a)ipfire.org>
Date:   Tue Jan 28 20:31:22 2020 +0000

    convert-dns-settings: remove DNS settings also if no server config is generated
    
    Signed-off-by: Arne Fitzenreiter <arne_f(a)ipfire.org>

-----------------------------------------------------------------------

Summary of changes:
 src/scripts/convert-dns-settings | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

Difference in files:
diff --git a/src/scripts/convert-dns-settings b/src/scripts/convert-dns-settings
index 1d9b22dcd..23d76ec88 100755
--- a/src/scripts/convert-dns-settings
+++ b/src/scripts/convert-dns-settings
@@ -19,6 +19,12 @@
 #                                                                             #
 ###############################################################################
 
+FILES=(
+	/var/ipfire/ethernet/settings
+	/var/ipfire/dns/settings
+	/var/ipfire/ppp/settings-*
+)
+
 main() {
 	# Do not convert anything if we already have some servers set
 	if [ ! -s "/var/ipfire/dns/servers" ]; then
@@ -27,7 +33,7 @@ main() {
 
 		# Loop through all PPP profiles
 		local file
-		for file in /var/ipfire/ethernet/settings /var/ipfire/dns/settings /var/ipfire/ppp/settings-*; do
+		for file in "${FILES[@]}"; do
 			if [ -s "${file}" ]; then
 				local DNS0 DNS1 DNS2
 				eval $(/usr/local/bin/readhash "${file}")
@@ -37,9 +43,6 @@ main() {
 				for var in DNS0 DNS1 DNS2; do
 					SERVERS+=( "${!var}" )
 				done
-
-				# Remove DNS, DNS0, DNS1 and DNS2 settings from profile file
-				sed -Ei "/^DNS[012]?=/d" "${file}"
 			fi
 		done
 
@@ -62,6 +65,13 @@ main() {
 		fi
 	fi
 
+	# Remove all old settings from files
+	local file
+	for file in "${FILES[@]}"; do	
+		# Remove DNS, DNS0, DNS1 and DNS2
+		sed -Ei "/^DNS[012]?=/d" "${file}"
+	done
+
 	# Set correct ownership.
 	chown nobody:nobody /var/ipfire/dns/settings
 


hooks/post-receive
--
IPFire 2.x development tree

                 reply	other threads:[~2020-01-28 21:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=486gG25gtFz30hP@people01.haj.ipfire.org \
    --to=git@ipfire.org \
    --cc=ipfire-scm@lists.ipfire.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox