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@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@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