petits-scripts-persos/switch-vpn
2022-02-24 16:46:22 +01:00

10 lines
340 B
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/sh
if [ -n "$(nmcli connection show rezine_vpn37_udp | grep activated)" ] ; then
nmcli connection down rezine_vpn37_udp
else
nmcli connection up rezine_vpn37_udp
fi
nmcli connection show rezine_vpn37_udp | grep 'VPN connected' &>/dev/null
[ "$?" -eq 0 ] && notify-send 'VPN UDP connecté' || notify-send 'VPN UDP stoppé'