From 64b1f1e02fbda8788ca87d510354c08577f1d14c Mon Sep 17 00:00:00 2001 From: sevi-kun Date: Fri, 20 Jun 2025 21:44:00 +0200 Subject: [PATCH] move mozvpn to archive --- archive/toggle-mozvpn.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 archive/toggle-mozvpn.sh diff --git a/archive/toggle-mozvpn.sh b/archive/toggle-mozvpn.sh new file mode 100644 index 0000000..827d91a --- /dev/null +++ b/archive/toggle-mozvpn.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +STATE=$(mozillavpn status | grep "VPN state" | awk '{print $3}') +LOCATION=$(mozillavpn status | grep "Server city" | awk '{print $3}') + +if [ "$STATE" == "off" ]; then + FEEDBACK=$(mozillavpn activate) + if [[ $FEEDBACK == *"The VPN tunnel is now active"* ]]; then + notify-send -i /usr/share/icons/hicolor/32x32/apps/mozillavpn.png "Mozilla VPN" "VPN Activated: $LOCATION" + else + notify-send --urgency=critical -i /usr/share/icons/hicolor/32x32/apps/mozillavpn.png "Mozilla VPN" "Error" + fi +fi + +if [ "$STATE" == "on" ]; then + FEEDBACK=$(mozillavpn deactivate) + if [[ $FEEDBACK == *"The VPN tunnel is now inactive"* ]]; then + notify-send -i /usr/share/icons/hicolor/32x32/apps/mozillavpn.png "Mozilla VPN" "VPN Deactivated" + else + notify-send --urgency=critical -i /usr/share/icons/hicolor/32x32/apps/mozillavpn.png "Mozilla VPN" "Error" + fi +fi