rc.services: exclude wireguard VPN docker tunnels

This commit is contained in:
bergware
2023-07-18 13:38:38 +02:00
parent f427471e24
commit ea8c4e57e1

View File

@@ -190,8 +190,10 @@ check() {
nets=()
while IFS='\n' read -r net; do
net=($net)
# exclude wireguard tunnels for ntp
[[ ${net:0:2} == wg && $CALLER == ntp ]] && continue
# exclude wireguard VPN docker tunnels and ntp
[[ ${net:0:2} == wg && ($CALLER == ntp || $(grep -Pom1 '^TYPE:1="\K[^"]+' $WIREGUARD/$net.cfg) == 8) ]] && continue
[[ ${net:0:2} == wg && $(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)
@@ -204,8 +206,10 @@ check() {
nets=()
while IFS='\n' read -r net; do
net=($net)
# exclude wireguard VPN docker tunnels and ntp
[[ ${net:0:2} == wg && ($CALLER == ntp || $(grep -Pom1 '^TYPE:1="\K[^"]+' $WIREGUARD/$net.cfg) == 8) ]] && continue
# exclude wireguard tunnels for ntp
[[ ${net:0:2} == wg && $CALLER == ntp ]] && continue
# exclude wireguard VPN docker tunnels
[[ ${net:0:2} == wg && $(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)