Merge branch 'main' into v4.1-dev

This commit is contained in:
Donald Zou
2024-11-08 00:29:01 +08:00
committed by GitHub
12 changed files with 242 additions and 754 deletions

View File

@@ -147,11 +147,13 @@ start_core() {
break
else
if [ ! -f "/etc/wireguard/${interface}.conf" ]; then
echo "Ignoring ${interface}"
elif [ -f "/etc/wireguard/${interface}.conf" ]; then
echo "Isolating interface:" "$interface"
upblocking=$(grep -c "PostUp = iptables -I FORWARD -i ${interface} -o ${interface} -j DROP" /etc/wireguard/"${interface}".conf)
@@ -172,12 +174,14 @@ start_core() {
# Removing isolation for the configurations that did not match.
for interface in "${non_isolate[@]}"; do
if [ ! -f "/etc/wireguard/${interface}.conf" ]; then
echo "Ignoring ${interface}"
elif [ -f "/etc/wireguard/${interface}.conf" ]; then
echo "Removing isolation, if isolation is present for:" "$interface"
sed -i "/PostUp = iptables -I FORWARD -i ${interface} -o ${interface} -j DROP/d" /etc/wireguard/"${interface}".conf