From 354ccc87ab9421f76932a6b0cffcc2dd0a42d457 Mon Sep 17 00:00:00 2001 From: deflax Date: Thu, 9 Nov 2023 19:54:21 -0500 Subject: [PATCH] check for clients on first run --- wgstats.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wgstats.sh b/wgstats.sh index 4a636c4..87f741d 100755 --- a/wgstats.sh +++ b/wgstats.sh @@ -6,6 +6,12 @@ echo "] WireGate plugins:" systemctl list-timers --all | grep 'ACTIVATES\|wgldapsync' echo "" +if [ ! -d /etc/wireguard/clients ]; then + echo "] WireGate peers: " + echo "None. Create some :)" + exit 1 +fi + echo "] WireGate peers:" tmpfile1=$(mktemp /tmp/wgstats.1.XXXXXX) tmpfile2=$(mktemp /tmp/wgstats.2.XXXXXX)