-
Notifications
You must be signed in to change notification settings - Fork 0
/
nordvpn.sh
137 lines (121 loc) · 3.8 KB
/
nordvpn.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#!/bin/bash
function isrunning()
{
pidof -s "$1" > /dev/null 2>&1
status=$?
if [[ "$status" -eq 0 ]]; then
echo 1
else
echo 0
fi
}
clear
echo "LOADING..."
sleep 1
clear
sleep 1
echo "."
sleep 1
clear
echo ".."
sleep 1
clear
echo "..."
sleep 1
clear
echo "STARTING..."
sleep 1
clear
echo "––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––"
echo "––––––––––––––––––-------– Greco395 NordVPN Client --------––––––----––––––––––"
echo "––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––"
if [[ $(isrunning openvpn) -eq 1 ]];
then
red=`tput setaf 1`
green=`tput setaf 2`
reset=`tput sgr0`
echo "${red}STATUS: ${green}running${reset}"
else
red=`tput setaf 1`
green=`tput setaf 2`
reset=`tput sgr0`
echo "${red}STATUS: stopped${reset}"
fi
echo -e "\nSELEZIONARE IL PROTOCOSSO SUL QUALE SI VUOLE LA PROTEZIONE\n1)tcp protection\n2)udp protection\n3)disconnect all\n4)guide\n5)exit\n"
read type
if [ $type == 1 ]
then
pathToFile="/etc/openvpn/ovpn_tcp"
protocol="tcp"
ls /etc/openvpn/ovpn_tcp/
elif [ $type == 2 ]
then
pathToFile="/etc/openvpn/ovpn_udp"
protocol="udp"
ls /etc/openvpn/ovpn_udp/
elif [ $type == 3 ]
then
sudo killall openvpn
sudo killall openvpn
sudo service openvpn stop
echo "SERVIZION VPN DISCONNESSO"
./nordvpn.sh
elif [ $type == 4 ]
then
clear
echo "––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––"
echo "––––––––––––––––––---- Greco395 NordVPN Client Guide -----––––––----––––––––––"
echo "––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––"
red=`tput setaf 1`
green=`tput setaf 2`
reset=`tput sgr0`
echo -e "\n${red}Script by Greco395${reset} ( ${green}greco395.com${reset} )\n"
echo -e "-> apt-get install gnome-terminal\n-> sudo apt-get install openvpn\n-> cd /etc/openvpn/\n-> sudo wget https://downloads.nordcdn.com/configs/archives/servers/ovpn.zip\n-> sudo unzip ovpn.zip\n-> sudo rm ovpn.zip\n\n"
echo -e "Se esegui questi comandi questo script funzionerà correttamente.\npremi invio per continuare"
read action
./nordvpn.sh
elif [ $type == 5 ]
then
exit 1
exit 113
exit
else
echo "Selezione non valida"
exit 1
fi
echo -e "\n"
echo -e "SELEZIONA LO LA VPN ( example: it13 )\n"
read file_pre
file="$file_pre.nordvpn.com.$protocol.ovpn"
if [ $type == 1 ]
then
if [ -z "${file}" ]
then
selected_file="it13.nordvpn.com.tcp.ovpn"
else
selected_file=$file
fi
elif [ $type == 2 ]
then
if [ -z "${file}" ]
then
selected_file="it13.nordvpn.com.udp.ovpn"
else
selected_file=$file
fi
fi
# echo $selected_file
echo -e "FILE SEZIONATO CORRETTAMENTE\n\navvio in "
sleep 1
echo 2
sleep 1
echo 1
sleep 1
echo AVVIO IN CORSO...
sleep 1
gnome-terminal -x sh -c './nordvpn.sh; bash'
sleep 1
sudo openvpn --config "$pathToFile/$selected_file" --auth-user-pass "/etc/openvpn/pass.txt"
echo "reloading..."
sleep 5
./nordvpn.sh