mulvad: Do not unlock pass when disabling tunnel

upower
Simon Bruder 2021-06-01 11:37:59 +02:00
parent c0efaa02ba
commit 8259b1455f
Signed by: simon
GPG Key ID: 8D3C82F9F309F8EC
1 changed files with 4 additions and 4 deletions

View File

@ -25,16 +25,16 @@ cmd() {
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
interface="${interface#/sys/class/net/}"
[[ $interface =~ ^mullvad-(v6-)?[a-z]{2}[0-9]*$ ]] && cmd wg-quick down "$interface"
done
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"
pass web/mullvad.net/wireguard | while read -r line; do
key="${line%%: *}"