Add shell function for quick management of vpn

legacy
Simon Bruder 2019-09-07 15:58:30 +00:00
parent cbf69c7905
commit 1b40a42c9c
No known key found for this signature in database
GPG Key ID: 6F03E0000CC5B62F
1 changed files with 13 additions and 0 deletions

View File

@ -129,6 +129,19 @@ function ssim() {
ffmpeg -loglevel fatal -i "$1" -i "$2" -lavfi 'ssim=/dev/stdout' -f null -
}
function mullvad() (
if (( $# < 1 )); then
echo "USAGE: $0 LOCATION|off" >&2
fi
current_interfaces="$(ip -o a|grep -o '[0-9]*:\ mullvad-[a-z][a-z][0-9]*'|uniq|cut -d: -f2|tr -d ' ')"
for current_interface in $current_interfaces; do
sudo wg-quick down "$current_interface"
done
if [ "$1" != "off" ]; then
sudo wg-quick up mullvad-$1
fi
)
# Audacious does not support symlinks; hack around that
function audacious-hack() (
IFS=$'\n'