From 9997f059b41ffb09bfdf81b3cf2c9612aa622643 Mon Sep 17 00:00:00 2001 From: Saumit Date: Sat, 21 Sep 2024 16:15:45 +0530 Subject: .scripts: Adding efi-grub-entry, vpn, and work script --- .scripts/spunup-vpn | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 .scripts/spunup-vpn (limited to '.scripts/spunup-vpn') diff --git a/.scripts/spunup-vpn b/.scripts/spunup-vpn new file mode 100755 index 0000000..80cd0dc --- /dev/null +++ b/.scripts/spunup-vpn @@ -0,0 +1,13 @@ +#!/bin/bash +VPN_USER=$(pass show OpenVPN-user) +VPN_PASSWORD=$(pass show OpenVPN-pass) + +OVPN_FILES=(*.ovpn) +if [ ${#OVPN_FILES[@]} -eq 0 ]; then + echo "No .ovpn files found in $OVPN_DIR." + exit 1 +fi +CONFIG_FILE=${OVPN_FILES[RANDOM % ${#OVPN_FILES[@]}]} + + +sudo bash -c 'openvpn --config '"$CONFIG_FILE"' --auth-user-pass <(echo -e "'"$VPN_USER"'\n'"$VPN_PASSWORD"'")' -- cgit v1.2.3