-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathzsh_functions
More file actions
29 lines (24 loc) · 776 Bytes
/
zsh_functions
File metadata and controls
29 lines (24 loc) · 776 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#HTB VPN Connection Manager
function htbstart() {
#Configure your config directory here
OVPN_CONFIG_DIR=~/.ovpnconfig
# List all .ovpn files in the directory and let the user select one
echo "Please select an ovpn file to connect:"
select ovpn_file in $OVPN_CONFIG_DIR/*.ovpn; do
if [ -n "$ovpn_file" ]; then
echo "Starting OpenVPN with $ovpn_file..."
sudo -v
sudo openvpn "$ovpn_file" 1>/dev/null 2>&1 &
echo "Connection to HTB initiated. Have fun storming the castle!"
break
else
echo "Invalid selection. Please try again."
fi
done
}
function htbkill() {
echo "Disconnecting from HTB VPN..."
# Find and kill the openvpn process
sudo killall openvpn
echo "Disconnected from HTB VPN. See you next time!"
}