From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arne Fitzenreiter To: ipfire-scm@lists.ipfire.org Subject: [git.ipfire.org] IPFire 2.x development tree branch, master, updated. 15e34194346674213e2cff30828f6f764311a685 Date: Tue, 28 Jan 2020 21:47:19 +0000 Message-ID: <486gFN3G4Dz30hP@people01.haj.ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4384429299230185898==" List-Id: --===============4384429299230185898== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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, master 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 Date: Tue Jan 28 20:31:22 2020 +0000 convert-dns-settings: remove DNS settings also if no server config is gen= erated =20 Signed-off-by: Arne Fitzenreiter ----------------------------------------------------------------------- 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-setti= ngs index 1d9b22dcd..23d76ec88 100755 --- a/src/scripts/convert-dns-settings +++ b/src/scripts/convert-dns-settings @@ -19,6 +19,12 @@ # = # ############################################################################= ### =20 +FILES=3D( + /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() { =20 # Loop through all PPP profiles local file - for file in /var/ipfire/ethernet/settings /var/ipfire/dns/settings /var/ip= fire/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+=3D( "${!var}" ) done - - # Remove DNS, DNS0, DNS1 and DNS2 settings from profile file - sed -Ei "/^DNS[012]?=3D/d" "${file}" fi done =20 @@ -62,6 +65,13 @@ main() { fi fi =20 + # Remove all old settings from files + local file + for file in "${FILES[@]}"; do=09 + # Remove DNS, DNS0, DNS1 and DNS2 + sed -Ei "/^DNS[012]?=3D/d" "${file}" + done + # Set correct ownership. chown nobody:nobody /var/ipfire/dns/settings =20 hooks/post-receive -- IPFire 2.x development tree --===============4384429299230185898==--