add preview screenshot

This commit is contained in:
DACHXY 2025-03-10 16:39:41 +08:00
parent 796176480e
commit a304926231
7 changed files with 47 additions and 1 deletions

20
home/config/scripts/wgStatus.sh Executable file
View file

@ -0,0 +1,20 @@
#!/usr/bin/env bash
INTERFACE="wg0"
if [ "$1" = "toggle" ]; then
if ip link show "$INTERFACE" >/dev/null 2>&1; then
pkexec wg-quick down "$INTERFACE"
else
pkexec wg-quick up "$INTERFACE"
fi
exit 0
fi
if ! ip link show "$INTERFACE" >/dev/null 2>&1; then
echo "{\"text\": \"Not Connected\", \"tooltip\": \"WireGuard is down\", \"alt\": \"disconnected\", \"class\": \"disconnected\"}"
exit 0
fi
echo "{\"text\": \"Connected\", \"tooltip\": \"WireGuard connected\", \"alt\": \"connected\", \"class\": \"connected\"}"
exit 0