2024-02-17 14:31:00 +01:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
|
|
|
|
# Check if wireguard VPN is active
|
|
|
|
if nmcli c show --active | grep -q wireguard; then
|
2024-02-18 12:45:44 +01:00
|
|
|
echo '{"text": "VPN", "class": "up"}'
|
2024-02-17 14:31:00 +01:00
|
|
|
# If not, check if the connection named "YapiBiche" is active
|
|
|
|
elif nmcli c show --active | grep -q "YapiBiche"; then
|
2024-02-18 12:45:44 +01:00
|
|
|
echo '{"text": "LAN", "class": "up"}'
|
2024-02-17 14:31:00 +01:00
|
|
|
# If neither is active, return "NO"
|
|
|
|
else
|
2024-02-18 12:45:44 +01:00
|
|
|
echo '{"text": "OFF", "class": "down"}'
|
2024-02-17 14:31:00 +01:00
|
|
|
fi
|