Add shell function for quick management of vpn
This commit is contained in:
parent
cbf69c7905
commit
1b40a42c9c
|
@ -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'
|
||||
|
|
Reference in a new issue