-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunNord.sh
218 lines (198 loc) · 10.2 KB
/
runNord.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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
#!/bin/bash
# Written by tuiVYeqr/nRr1+Qgp5+qyl/KGJmELU9U6f9uv6mSeYE= .
# a very simple bash interface ment to help streamline testing
# or the actuall setup of nordvpn in Linux. The nickname feature is not included.
# Its to kind of keep it simple to new users, to avoid name mixups.
# 2024-06-03
echo "Have you installed NordVPN?"
options0=("Yes 1" "No 2")
select op in "${options0[@]}"
do
case $op in
"Yes 1")
echo " Now would be a good time to make sure that you're logged in :) "
echo " Running command: nordvpn login "
nordvpn login
echo " but you could also continue without logging in "
read -sn 1 -p "Press any key to continue..."
echo " We will also try to connect you now to NordVPN servres! let it finish"
echo " If you did not login you will continue without being connected and this will just return a small error, no worries! :)"
echo " Running command: nordvpn connect"
nordvpn connect
read -sn 1 -p "Press any key to continue..."
clear
PS3='Please enter your choice: by number or string. '
options=("Settings 1" "Meshnet 2" "Status 3" "StartVPN 4" "StopVPN 5" "Quit 6")
select opt in "${options[@]}"
do
case $opt in
"Settings 1")
echo "Apply the 'set' settings in NordVPN"
echo -n "set to threatprotectionlite 1 or 0: "
read threatprotectionlite
nordvpn set threatprotectionlite $threatprotectionlite
echo -n "set to firewall 1 or 0: "
read firewall
nordvpn set firewall $firewall
echo -n "set to fwmark 1 or 0: "
read fwmark
nordvpn set fwmark $fwmark
echo -n "set to ipv6 1 or 0: "
read ipv6
nordvpn set ipv6 $ipv6
echo -n "set to notify 1 or 0: "
read notify
nordvpn set notify $notify
echo -n "set routing to 1 or 0: "
read routing
nordvpn set routing $routing
echo -n "set to analytics 1 or 0: "
read analytics
nordvpn set analytics $analytics
echo -n "set to autoconnect 1 or 0: "
read autoconnect
nordvpn set autoconnect $autoconnect
echo -n "set to mesh 1 or 0: "
read mesh
nordvpn set mesh $mesh
echo -n "set to killswitch 1 or 0: "
read killswitch
nordvpn set killswitch $killswitch
echo -n "set to lan-discovery 1 or 0: "
read lan
nordvpn set lan-discovery $lan
echo -e "***************************"
echo -e "*** YOUR NORDVPN STATUS ***"
echo -e "***************************"
echo -e '\n'
nordvpn status
echo -e "*****************************"
echo -e "*** YOUR NORDVPN SETTINGS ***"
echo -e "*****************************"
echo -e '\n'
nordvpn settings
echo -e "\n"
;;
"Meshnet 2")
echo "Now we we look at your Meshnet settings"
echo " First you need to set the name or nickname of the targetmachine that you wish to configure"
echo " The statments will take either allow/deny or yes/no awnsers depending on the question."
echo " Each statment will contain the apporopiate information"
echo " You will now be prometed with a list showing the names and information about each peer in your network"
read -sn 1 -p "Press any key to continue..."
echo -e "***************************"
echo -e "******** peer list ********"
echo -e "***************************"
echo -e "\n"
nordvpn mesh peer list
echo -e "Now please fill out the Name of your target machine: "
read target
echo -n "press Enter to contineue"
read ans
echo -n "set incoming connections to this current device allow/deny: "
read incoming
nordvpn meshnet peer incoming $incoming $target
echo -n "set routing to be allowed through THIS DEVICE, i.e use this device as an endpoint alLow/deny: "
read routing
nordvpn meshnet peer routing $routing $target
echo -n "set local this device to be visability on local lan to allow/deny: "
read local
nordvpn meshnet peer local $local $target
echo -n "set fileshareing to be allowed or denyed to THIS DEVICE, allow/deny: "
read fileshareing
nordvpn meshnet peer fileshare $fileshareing $target
echo -n "shall AutoAccept incoming files be allowed or denyed on THIS DEVICE, allow/deny: "
read $AutoAccept
nordvpn meshnet peer auto-accept $AutoAccept $target
echo -n "would you like to connect this device to your TARGETMACHINE and use it as an endpoint? allow/deny: "
read connect
nordvpn meshnet peer connect $target $connect
echo -e "***************************"
echo -e "*** YOUR NORDVPN STATUS ***"
echo -e "***************************"
echo -echo -e "\n"e '\n'
nordvpn status
echo -e "*****************************"
echo -e "*** YOUR NORDVPN SETTINGS ***"
echo -e "*****************************"
echo -e '\n'
nordvpn settings
echo -e "\n"
;;
"Status 3")
echo "This is your current status and settings:"
echo -e '\n'
echo -e "***************************"
echo -e "*** YOUR NORDVPN STATUS ***"
echo -e "***************************"
nordvpn version
echo -e '\n'
nordvpn status
echo -e "*****************************"
echo -e "*** YOUR NORDVPN SETTINGS ***"
echo -e "*****************************"
echo -e '\n'
nordvpn settings
echo -e "\n"
echo -e "***************************"
echo -e "*** YOUR ACCOUNT INFO ***"
echo -e "***************************"
nordvpn version
nordvpn account
echo -e "*********************************"
echo -e "***List of available countries***"
echo -e "*********************************"
echo -e "\n"
nordvpn countries
;;
"StartVPN 4")
nordvpn connect
echo -e "***************************"
echo -e "*** YOUR NORDVPN STATUS ***"
echo -e "***************************"
echo -e '\n'
nordvpn status
;;
"StopVPN 5")
nordvpn disconnect
echo -e "***************************"
echo -e "*** YOUR NORDVPN STATUS ***"
echo -e "***************************"
echo -e '\n'
nordvpn status
nordvpn logout
;;
"Quit 6")
exit
;;
*) echo "invalid option $REPLY";;
esac
echo 'To re-run: Press enter for the menu or is it byebye time: write 6'
options=("Settings 1" "Meshnet 2" "Status 3" "StartVPN 4" "StopVPN 5" "Quit 6")
#echo "$options"
done
;;
"No 2")
echo -e "Lets install it then??"
options1=("yes 1" "nah 2")
select optt in "${options1[@]}"
do
case $optt in
"yes 1")
echo -e "running : sh <(curl -sSf https://downloads.nordcdn.com/apps/linux/install.sh) To install "
sh <(curl -sSf https://downloads.nordcdn.com/apps/linux/install.sh)
echo -e "Now lets login by running: nordvpn login "
nordvpn login
echo -e " To connect run the command 'nordvpn connect' " once youre done logging in.
echo -e "#nordvpn connect "
echo "To see full instaltaion guide, vistit: https://nordvpn.com/download/linux/ "
;;
"Nah 2")
break
;;
esac
done
;;
*) echo "invalid option $REPLY";;
esac
done