From 3cc178f690f2103c99b96fb5901a241f3565ab27 Mon Sep 17 00:00:00 2001 From: gyurix Date: Tue, 1 Aug 2023 06:24:36 +0000 Subject: [PATCH] Added persistent keep alive script instead of built in wireguard ping process --- persistentkeepalive.sh | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100755 persistentkeepalive.sh diff --git a/persistentkeepalive.sh b/persistentkeepalive.sh new file mode 100755 index 0000000..817b682 --- /dev/null +++ b/persistentkeepalive.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +sleep 15; +PERSISTENT_KEEP_ALIVE=$(cat /etc/wireguard/wg0.conf | grep PersistentKeepalive | awk '{print $3}'); +WG_SERVER_IP="$(cat /etc/wireguard/wg0.conf | grep Address | awk '{print $3}' | cut -d . -f1-3).1"; +ping -s 0 -I wg0 -i $PERSISTENT_KEEP_ALIVE $WG_SERVER_IP