-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathvpn-ssh.sh
executable file
·45 lines (35 loc) · 926 Bytes
/
vpn-ssh.sh
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
# Written By Woland
# A helper script for sshuttle
#Dpendency:
# sshuttle
# Add your servers to the options array. The syntax is ip:port
# https://github.com/wolandark
# https://github.com/wolandark/BASH_Scripts_For_Everyone
PS3="Select the server you wish to connect to: "
options=(
1.1.1.1:22
2.2.2.2:80
3.3.3.3:2222
)
default_subnet="0/0"
select choice in "${options[@]}";
do
echo -e "\nEnter subnet. Default 0/0\nPress Enter to confirm or input subnet"
read -r subnet
if [[ $subnet =~ ^[Yy]$ || -z $subnet ]];
then
subnet="$default_subnet"
fi
echo -e "\nDo you wish to tunnel DNS too?\n Answer y, yes or Enter to confirm"
read -r ans
if [[ $ans == "y" || $ans == "yes" || -z $ans ]];
then
echo "sshuttle -r '$choice' '$subnet' --dns"
sshuttle -r "$choice" "$subnet" --dns
else
echo "sshuttle -r '$choice' '$subnet'"
sshuttle -r "$choice" "$subnet"
fi
break
done