test
This commit is contained in:
7
nix.sh
7
nix.sh
@@ -3,11 +3,18 @@ set -e -u -o pipefail
|
||||
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null && pwd)"
|
||||
VPN=vpn0
|
||||
|
||||
: ${1:?Missing decrypt pass}
|
||||
: ${2:?Missing topt but needed}
|
||||
|
||||
dot_env_secret=$(echo 'U2FsdGVkX1+ZpYMKJgqLZC7uedR4GhfB6/8Q+xdq0rH9v2S/pNTBBpdjlS/Fy5eNRsMGRSYf/HoZNihIYiAskKOY7mg6+t5vRUXWh73BQHuUVD2uAUc5npgP/Lmyn2wR2qWoBfTToKeu0nI5Gh7VQw==' | \
|
||||
openssl enc -aes-256-cbc -pbkdf2 -d -a -A -pass pass:$1)
|
||||
|
||||
export $( echo $dot_env_secret | grep "=" | grep -v "#" | xargs )
|
||||
|
||||
: ${VPN_PEM_PASS:?Missing but needed}
|
||||
: ${VPN_USER:?Missing but needed}
|
||||
: ${VPN_USER_PASS:?Missing but needed}
|
||||
|
||||
expect $DIR/vpn.exp $VPN_PEM_PASS $VPN_USER $VPN_USER_PASS $2
|
||||
|
||||
sudo ip route delete 10.0.0.0/8 dev $VPN metric 50 || true
|
||||
|
||||
Reference in New Issue
Block a user