mirror of
https://github.com/unraid/webgui.git
synced 2026-02-06 17:09:11 -06:00
rc.services: exclude wireguard tunnels for ntp (code optimization)
This commit is contained in:
@@ -190,15 +190,14 @@ check() {
|
||||
nets=()
|
||||
while IFS='\n' read -r net; do
|
||||
net=($net)
|
||||
# exclude wireguard VPN docker tunnels
|
||||
[[ ${net:0:2} == wg && $(grep -Pom1 '^TYPE:1="\K[^"]+' $WIREGUARD/$net.cfg) == 8 ]] && continue
|
||||
# exclude wireguard VPN docker tunnels and ntp
|
||||
[[ ${net:0:2} == wg && ($CALLER == ntp || $(grep -Pom1 '^TYPE:1="\K[^"]+' $WIREGUARD/$net.cfg) == 8) ]] && continue
|
||||
net1=$(sub ${net[1]})
|
||||
if [[ "avahi show" =~ $CALLER ]]; then
|
||||
[[ -n $net && -n $net1 && -z $(good $net $net1) ]] && bind+=($net)
|
||||
[[ -n $net1 ]] && ipv4=yes nets+=($net1)
|
||||
else
|
||||
# exclude wireguard tunnels for ntp
|
||||
[[ $CALLER == ntp && ${net:0:2} == wg ]] && continue
|
||||
[[ -n $net1 && -z $(good $net1) ]] && ipv4=yes bind+=($net1)
|
||||
fi
|
||||
done <<< $(ip -br -4 addr show scope global|awk '/^(br|bond|eth|wg)[0-9]+(\.[0-9]+)?/ {print $1,$3}'|sort)
|
||||
@@ -206,15 +205,14 @@ check() {
|
||||
nets=()
|
||||
while IFS='\n' read -r net; do
|
||||
net=($net)
|
||||
# exclude wireguard VPN docker tunnels
|
||||
[[ ${net:0:2} == wg && $(grep -Pom1 '^TYPE:1="\K[^"]+' $WIREGUARD/$net.cfg) == 8 ]] && continue
|
||||
# exclude wireguard VPN docker tunnels and ntp
|
||||
[[ ${net:0:2} == wg && ($CALLER == ntp || $(grep -Pom1 '^TYPE:1="\K[^"]+' $WIREGUARD/$net.cfg) == 8) ]] && continue
|
||||
net1=$(sub $(main ${net[@]}))
|
||||
if [[ "avahi show" =~ $CALLER ]]; then
|
||||
[[ -n $net && -n $net1 && -z $(good $net $net1) ]] && bind+=($net)
|
||||
[[ -n $net1 ]] && ipv6=yes nets+=($net1)
|
||||
else
|
||||
# exclude wireguard tunnels for ntp
|
||||
[[ $CALLER == ntp && ${net:0:2} == wg ]] && continue
|
||||
[[ -z $deny6 && -n $net1 && -z $(good $net1) ]] && ipv6=yes bind+=($net1)
|
||||
fi
|
||||
done <<< $(ip -br -6 addr show scope global|awk '/^(br|bond|eth|wg)[0-9]+(\.[0-9]+)?/{$2="";print}'|sort)
|
||||
|
||||
Reference in New Issue
Block a user