Add v6 support to mullvad shell function

This commit is contained in:
Simon Bruder 2019-11-02 15:55:32 +00:00
parent 57610816be
commit ccff6c8df3
No known key found for this signature in database
GPG key ID: 6F03E0000CC5B62F

View file

@ -133,7 +133,7 @@ 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 ' ')"
current_interfaces="$(ip -o a|grep -oE '[0-9]*:\ mullvad-(v6-)?[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