Skip to content

Commit

Permalink
Update wg_server
Browse files Browse the repository at this point in the history
FIX: @server' Peer Passthru feature is missing the necessary RPDB rule (Rewrite regression) - Thanks SNB Forum member @ Chongnt)
FIX: When terminating a @server' Peer configured forPassthru, the passthru 'client' Peer wgxx-down.sh script is executed rather than the 'server' Peer script - Thanks SNB Forum member @ Chongnt)
  • Loading branch information
MartineauUK authored Dec 15, 2021
1 parent 479afab commit 7c686e1
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions wg_server
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/bin/sh
VERSION="v4.12"
#============================================================================================ © 2021 Martineau v4.12
VERSION="v4.13"
#============================================================================================ © 2021 Martineau v4.13
#

# Maintainer: Martineau
# Last Updated Date: 12-Dec-2021
# Last Updated Date: 15-Dec-2021
#
# Description:
#
# Acknowledgement:
#
# Contributors: odkrys,ZebMcKayhan,Torson
# Contributors: odkrys,ZebMcKayhan,Torson,chongnt

# shellcheck disable=SC2034
ANSIColours() {
Expand Down Expand Up @@ -56,6 +56,7 @@ Firewall_delete() {
Manage_Passthru(){

local PASSTHRU_CLIENTS=$(sqlite3 /opt/etc/wireguard.d/WireGuard.db "SELECT client FROM passthru where server='$WG_INTERFACE';" | sort | uniq | tr '\n' ' ')
local VPN_ID= # v4.13 Fix @chongnt

local ACTION="add"
[ -n "$1" ] && ACTION=$1 # "del" or "add"
Expand All @@ -78,9 +79,10 @@ Manage_Passthru(){
done << EOR
$(ip route | grep "$WG_INTERFACE")
EOR
else
ip rule $ACTION from $IP_ADDR table $TABLE
fi

ip rule $ACTION from $IP_ADDR table $TABLE # v4.13 Fix @chongnt

else
ip rule $ACTION from $IP_ADDR table $TABLE 2>/dev/null
fi
Expand Down

0 comments on commit 7c686e1

Please sign in to comment.