i3_configuration/i3status/click_vpn.sh

13 lines
277 B
Bash
Raw Normal View History

2025-09-22 21:36:45 +02:00
#!/bin/sh
# Actually works for Wireguard
2025-09-22 21:36:45 +02:00
# we are connected if the directory exists
if [ -d /proc/sys/net/ipv4/conf/wg0 ]; then
# we are connected, so propose disconnexion
echo "Disconnect VPN"
sudo wg-quick down wg0
else
echo "Connect VPN"
sudo wg-quick up wg0
fi