-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
49 lines (34 loc) · 1.04 KB
/
install.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
#!/bin/bash
# Include the required functions
source lib/prompt.sh
source lib/serverSide.sh
source lib/clientSide.sh
# Set the current and log path
current_path=$(pwd)
log_path="$current_path/lib/log"
mkdir -p $log_path
# Start of the installation
message_start
echo "Setting up easy-rsa..."
easyrsa_setup &>$log_path/easyrsa_setup.txt
echo "Creating the vars file..."
create_vars_file
echo "Installing openvpn & ufw..."
base_install &>$log_path/base_install.txt
echo "Generating & signing certificates (this may take a while)..."
gen_sign &>/$log_path/gen_sign.txt
echo "Configuring the server..."
server_config
echo "IP forwarding..."
ip_forwarding &>$log_path/ip_forwarding.txt
echo "Configuring ufw..."
ufw_config &>$log_path/ufw_config.txt
echo "Starting service..."
service_start &>$log_path/service_start.txt
echo "Configuring client's ovpn file..."
client_config
echo "Generating client's ovpn file..."
sudo bash -c "$(declare -f generate_ovpn); generate_ovpn $(whoami)"
mv ~/client-configs/files/client1.ovpn ~/
# End of installation
message_end