mulvad: Do not unlock pass when disabling tunnel
This commit is contained in:
parent
c0efaa02ba
commit
8259b1455f
|
@ -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%%: *}"
|
||||||
|
|
Loading…
Reference in a new issue