-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanual_setup.sh
37 lines (26 loc) · 1001 Bytes
/
manual_setup.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
#!/bin/bash
echo "Updating software..."
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get autoremove -y
echo "Installing packages..."
sudo apt install -y openvpn v2ray squid
echo "OpenVPN setup: Editing config file..."
sudo nano /etc/openvpn/server.conf
echo "Generate encryption keys..."
sudo openvpn --genkey --secret /etc/openvpn/ta.key
sudo openvpn --genkey --secret /etc/openvpn/ta.key
echo "Starting and enabling OpenVPN..."
sudo systemctl start openvpn@server && sudo systemctl enable openvpn@server
echo "Configuring IP forwarding..."
sudo sysctl -w net.ipv4.ip_forward=1
sudo sysctl -p
echo "Adjusting Firewall Settings for OpenVPN..."
sudo ufw allow 1194/udp
sudo ufw reload
echo "V2Ray setup: Editing config file..."
sudo nano /etc/v2ray/config.json
echo "Starting and enabling V2Ray..."
sudo systemctl start v2ray && sudo systemctl enable v2ray
echo "Adjusting Firewall Settings for V2Ray..."
sudo ufw allow 12345
sudo ufw reload
echo "Script execution completed."