-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathVPNConnectScript.sh
83 lines (76 loc) · 1.93 KB
/
VPNConnectScript.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# !/bin/bash
# ZephrFish Anonine VPN Connect Script
#
#
# Internet Check
# Checks if machine has internet access via pinging google.com
# Declare Colour Variables
b='\033[1m'
u='\033[4m'
r='\E[31m'
g='\E[32m'
y='\E[33m'
m='\E[35m'
c='\E[36m'
w='\E[37m'
endc='\E[0m'
enda='\033[0m'
function checkinternet() {
ping -c 1 google.com > /dev/null
if [[ "$?" != 0 ]]
then
echo -e " Checking For Internet: ${r}FAILED${endc}
${y}You're Using a Fucking VPN Script and You have no Internet, That is enough internet for you today${endc}"
echo -e " ${b}Rerun When Not So Retarded${enda} I am away"
echo && sleep 2
kexit
else
echo -e " Checking For Internet: ${g}PASSED${endc}"
fi
}
checkinternet
# Root Check
# Checks if script is being run as sudo or root based upon username; will change in future to UID based
function rootcheck() {
if [[ $USER != "root" ]] ; then
echo "Please Note: This script must be run as root!"
exit 1
fi
echo -e " Checking For Root or Sudo: ${g}PASSED${endc}"
}
# VPN Locations Menu
# Carry out rootcheck first before running
rootcheck
#!/bin/bash
# Updated VPN Script
# ZephrFish
echo "######################################################"
echo "## VPN Connect Script ##"
echo "######################################################"
echo ""
echo ""
echo "Please Select from the Following optinos what server you want to connect to"
PS3='What server would you like to connect to?: '
options=("Amsterdam" "London" "Miami" "Moscow" "Quit")
select opt in "${options[@]}"
do
case $opt in
"Amsterdam")
openvpn --config /usr/vpnconf/Amsterdam.ovpn &
;;
"London")
openvpn --config /usr/vpnconf/London.ovpn &
break
;;
"Miami")
openvpn --config /usr/vpnconf/Miami.ovpn &
;;
"Moscow")
openvpn --config /usr/vpnconf/Moscow.ovpn &
;;
"Quit")
break
;;
*) echo "invalid option, please try again";;
esac
done