From: Arne Fitzenreiter <git@ipfire.org>
To: ipfire-scm@lists.ipfire.org
Subject: [git.ipfire.org] IPFire 2.x development tree branch, next, updated. dcc655efb8620b760d4b414203a54845ac9bbe34
Date: Sun, 19 Jan 2020 12:24:33 +0000 [thread overview]
Message-ID: <480vBB0l42z2y94@people01.haj.ipfire.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 4181 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 dcc655efb8620b760d4b414203a54845ac9bbe34 (commit)
via dc08d74d955861ff39013e35e42d46e54602692f (commit)
from 97f4b51474551b9076af00bb9fc69acd0eba9bfc (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 dcc655efb8620b760d4b414203a54845ac9bbe34
Author: Stefan Schantl <stefan.schantl(a)ipfire.org>
Date: Sat Jan 18 10:03:06 2020 +0100
convert-dns-settings: Import all possible PPP dialin profiles.
* Avoid from adding the same imported DNS server multiple times.
Signed-off-by: Stefan Schantl <stefan.schantl(a)ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f(a)ipfire.org>
commit dc08d74d955861ff39013e35e42d46e54602692f
Author: Arne Fitzenreiter <arne_f(a)ipfire.org>
Date: Sun Jan 19 12:23:54 2020 +0000
core140: fix typo
Signed-off-by: Arne Fitzenreiter <arne_f(a)ipfire.org>
-----------------------------------------------------------------------
Summary of changes:
config/rootfiles/core/140/filelists/files | 2 +-
src/scripts/convert-dns-settings | 44 ++++++++++++++++++++++++-------
2 files changed, 35 insertions(+), 11 deletions(-)
Difference in files:
diff --git a/config/rootfiles/core/140/filelists/files b/config/rootfiles/core/140/filelists/files
index 37ce80c6a..1bd2c314a 100644
--- a/config/rootfiles/core/140/filelists/files
+++ b/config/rootfiles/core/140/filelists/files
@@ -6,7 +6,7 @@ etc/rc.d/init.d/lvmetad
etc/rc.d/init.d/networking/dhcpcd.exe
etc/rc.d/init.d/networking/red
etc/rc.d/init.d/networking/red.up/05-update-dns-forwarders
-etc/rc.d/init.d/partresive
+etc/rc.d/init.d/partresize
etc/rc.d/init.d/suricata
etc/rc.d/init.d/unbound
etc/rc.d/rcsysinit.d/S09lvmetad
diff --git a/src/scripts/convert-dns-settings b/src/scripts/convert-dns-settings
index 04a5344f7..e9d4de86b 100755
--- a/src/scripts/convert-dns-settings
+++ b/src/scripts/convert-dns-settings
@@ -22,25 +22,49 @@
main() {
# Do not convert anything if we already have some servers set
if [ ! -s "/var/ipfire/dns/servers" ]; then
- local DNS0 DNS1 DNS2
+ # Array to store all found DNS servers.
+ SERVERS=()
+
+ # Try to get the DNS servers from ethernet settings file.
+ local DNS1 DNS2
eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings)
+ # Add the grabbed DNS servers to the servers array.
+ SERVERS+=($DNS1 $DNS2)
+
+ # Check if the ppp settings file is not empty.
if [ -s "/var/ipfire/ppp/settings" ]; then
- eval $(/usr/local/bin/readhash /var/ipfire/ppp/settings)
+ # Loop though all profile files.
+ for file in /var/ipfire/ppp/settings*; do
+ local DNS1 DNS2
+ eval $(/usr/local/bin/readhash $file)
+
+ # Add the DNS servers to the array of SERVERS.
+ for var in DNS1 DNS2; do
+ local server="${!var}"
+
+ # Check if the current server is allready part
+ # of the array.
+ for element in "${SERVERS[@]}"; do
+ [[ $element == $server ]] && continue
+ done
+
+ SERVERS+=($server)
+ done
+
+ # Remove DNS1 and DNS2 settings from profile file.
+ sed -i "/^DNS[12]?=/d" $file
+ done
- # Remove DNS, DNS1 and DNS2
- sed -i "/^DNS[12]?=/d" /var/ipfire/ppp/settings
elif [ -s "/var/ipfire/dns/settings" ]; then
eval $(/usr/local/bin/readhash /var/ipfire/dns/settings)
fi
- local var
+ local server
local i=3
- for var in DNS0 DNS1 DNS2; do
- if [ -n "${!var}" ]; then
- echo "${i},${!var},,enabled,"
- (( i++ ))
- fi
+ for server in "${SERVERS[@]}"; do
+ echo "${i},${server},,enabled,"
+ (( i++ ))
done > /var/ipfire/dns/servers
# Empty the old settings file
hooks/post-receive
--
IPFire 2.x development tree
reply other threads:[~2020-01-19 12:24 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=480vBB0l42z2y94@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