PKG_NAME:=wireguard-tools
PKG_VERSION:=1.0.20210424
-PKG_RELEASE:=1
+PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE:=wireguard-tools-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://git.zx2c4.com/wireguard-tools/snapshot/
proto_wireguard_setup_peer() {
local peer_config="$1"
+ local disabled
local public_key
local preshared_key
local allowed_ips
local endpoint_port
local persistent_keepalive
+ config_get_bool disabled "${peer_config}" "disabled" 0
config_get public_key "${peer_config}" "public_key"
config_get preshared_key "${peer_config}" "preshared_key"
config_get allowed_ips "${peer_config}" "allowed_ips"
config_get endpoint_port "${peer_config}" "endpoint_port"
config_get persistent_keepalive "${peer_config}" "persistent_keepalive"
+ if [ "${disabled}" -eq 1 ]; then
+ # skip disabled peers
+ return 0
+ fi
+
if [ -z "$public_key" ]; then
echo "Skipping peer config $peer_config because public key is not defined."
return 0
check_peer_activity() {
local cfg=$1
local iface=$2
+ local disabled
local public_key
local endpoint_host
local endpoint_port
local last_handshake
local idle_seconds
+ config_get_bool disabled "${cfg}" "disabled" 0
config_get public_key "${cfg}" "public_key"
config_get endpoint_host "${cfg}" "endpoint_host"
config_get endpoint_port "${cfg}" "endpoint_port"
+
+ if [ "${disabled}" -eq 1 ]; then
+ # skip disabled peers
+ return 0
+ fi
+
persistent_keepalive=$(wg show ${iface} persistent-keepalive | grep ${public_key} | awk '{print $2}')
# only process peers with endpoints and keepalive set