mulvad: Do not unlock pass when disabling tunnel

This commit is contained in:
Simon Bruder 2021-06-01 11:37:59 +02:00
parent c0efaa02ba
commit 8259b1455f
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC

View file

@ -25,16 +25,16 @@ cmd() {
sudo "$@" sudo "$@"
} }
# Make sure gpg-agent is unlocked so the period where the interface exists but
# no private key is set is minised.
pass web/mullvad.net/wireguard >/dev/null
for interface in /sys/class/net/*; do for interface in /sys/class/net/*; do
interface="${interface#/sys/class/net/}" interface="${interface#/sys/class/net/}"
[[ $interface =~ ^mullvad-(v6-)?[a-z]{2}[0-9]*$ ]] && cmd wg-quick down "$interface" [[ $interface =~ ^mullvad-(v6-)?[a-z]{2}[0-9]*$ ]] && cmd wg-quick down "$interface"
done done
if [ "$1" != "off" ]; then if [ "$1" != "off" ]; then
# Make sure gpg-agent is unlocked so the period where the interface exists but
# no private key is set is minised.
pass web/mullvad.net/wireguard >/dev/null
cmd wg-quick up "$INTERFACE" cmd wg-quick up "$INTERFACE"
pass web/mullvad.net/wireguard | while read -r line; do pass web/mullvad.net/wireguard | while read -r line; do
key="${line%%: *}" key="${line%%: *}"