fix: wireguard status for waybar

This commit is contained in:
DACHXY 2025-06-03 11:21:00 +08:00
parent e928d2e4c9
commit cc803cae27
11 changed files with 68 additions and 57 deletions

View file

@ -4,9 +4,9 @@ INTERFACE="wg0"
if [ "$1" = "toggle" ]; then
if ip link show "$INTERFACE" >/dev/null 2>&1; then
pkexec wg-quick down "$INTERFACE"
pkexec systemctl stop wg-quick-wg0.service
else
pkexec wg-quick up "$INTERFACE"
pkexec systemctl start wg-quick-wg0.service
fi
exit 0
fi