fix: parsing other tableentries than unicast; bump version

Signed-off-by: Blackyfff <freifunk@freifunk-herpf.de>
This commit is contained in:
Blackyfff 2021-08-31 01:06:25 +02:00
parent e171cc5a3c
commit 033a650f4b
2 changed files with 6 additions and 6 deletions

View File

@ -8,7 +8,7 @@
# exit script when command fails
set -e
export DNSSCRIPT_VERSION="0.8.4"
export DNSSCRIPT_VERSION="0.9.0"
. /etc/ffdns/community.conf
. /etc/ffdns/local.conf

View File

@ -23,17 +23,17 @@ else
Installed4Routes=""
Installed6Routes=""
for Table in $Tables; do
Installed4Routes="$(echo "$Installed4Routes" && ip -4 ro sh ta "$Table")"
Installed6Routes="$(echo "$Installed6Routes" && ip -6 ro sh ta "$Table")"
Installed4Routes="$(echo "$Installed4Routes" && ip -d -4 ro sh ta "$Table")"
Installed6Routes="$(echo "$Installed6Routes" && ip -d -6 ro sh ta "$Table")"
done
PublicSubs="$(echo "$Installed6Routes" | \
sed -e '/^default from/!d;s/.* from \(\S\+\).*/\1/g')"
sed -e '/^unicast default from/!d;s/.* from \(\S\+\).*/\1/g')"
Privatev4Prefix="\(192\.168\.\|172\.\(1[6-9]\|2[0-9]\|3[01]\)\.\|10\.\)"
Privatev6Prefix="\([fF][cCdD][0-9a-fA-F]\{2\}:\)"
Publicv4Singles="$(echo "$Installed4Routes" | \
sed -e 's/^\(\S\+\)\s.*/\t\1;/g;/^\t'"$Privatev4Prefix"'\|^\t\(unreachable\|default\|0\.\)\|^$/d')"
sed -e 's/^\S\+\s\+\(\S\+\)\s.*/\t\1;/g;/^\t'"$Privatev4Prefix"'\|^\t\(unreachable\|default\|0\.\)\|^$/d')"
Publicv6Singles="$(echo "$Installed6Routes" | \
sed -e 's/^\(\S\+\)\s.*/\1/g;/^'"$Privatev6Prefix"'\|^\(unreachable\|default\|::\|64:ff9b::\)\|^$/d')"
sed -e 's/^\S\+\s\+\(\S\+\)\s.*/\1/g;/^'"$Privatev6Prefix"'\|^\(unreachable\|default\|::\|64:ff9b::\)\|^$/d')"
# the following code is not well optimized yet and may take a bit to process
# therefore it is not recommended to activate it on hardware-routers