diff --git a/home/.zshrc.local b/home/.zshrc.local index 9162b76..4117376 100644 --- a/home/.zshrc.local +++ b/home/.zshrc.local @@ -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'