-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall.sh
executable file
·91 lines (82 loc) · 2.53 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
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
#!/bin/bash
check_if_running_as_root() {
# If you want to run as another user, please modify $EUID to be owned by this user
if [[ "$EUID" -ne '0' ]]; then
echo "$(tput setaf 1)Error: You must run this script as root!$(tput sgr0)"
exit 1
else
echo $(tput setaf 2)softether installing starting ...$(tput sgr0)
fi
}
check_os() {
# Get the operating system name and version
OS=$(lsb_release -si)
VERSION=$(lsb_release -sr)
# Check if the OS is Ubuntu
if [ "$OS" != "Ubuntu" ] ; then
echo $(tput setaf 1)This script only works on Ubuntu $(tput sgr0)
exit 1
fi
}
sysup() {
bash <(curl -s https://raw.githubusercontent.com/samsesh/Ubuntu-Optimizer/main/ubuntu-optimizer.sh)
}
req() {
#install softether requirement
apt install -y figlet
clear
figlet installing requirement
sleep 5
apt install -y build-essential make gcc zlib1g-dev libreadline-dev libncurses-dev libssl-dev
clear
}
install() {
#install softether - start
figlet installing softether
sleep 2
echo "v4.38-9760-rtm-2021.08.17-linux-x64-64bit"
sleep 2
# download softether
wget https://github.com/SoftEtherVPN/SoftEtherVPN_Stable/releases/download/v4.38-9760-rtm/softether-vpnserver-v4.38-9760-rtm-2021.08.17-linux-x64-64bit.tar.gz
#extart file
tar xzf softether-vpnserver-v4.38-9760-rtm-2021.08.17-linux-x64-64bit.tar.gz
# compiling softether
cd vpnserver/
make
cd ..
clear
# move to new dir
mv vpnserver /usr/local
# get file permission
chmod 600 /usr/local/vpnserver/*
chmod 700 /usr/local/vpnserver/vpnserver /usr/local/vpnserver/vpncmd
# start server
/usr/local/vpnserver/vpnserver start
# enable ip4 forward
echo net.ipv4.ip_forward = 1 | ${SUDO} tee -a /etc/sysctl.conf
# create vpn server service
mv ./vpnserver.service /lib/systemd/system/
# start vpn server service
systemctl start vpnserver.service
# add to start up vpn server service
systemctl enable vpnserver.service
#/usr/local/vpnserver/vpncmd
clear
figlet finish
sleep 2
echo "samsesh.net"
sleep 2
#install softether - end
echo "installed on /usr/local/vpnserver/"
sleep 2
echo "now go to install patch then run vpncmd and select ro service then for set password on use this command on ./vpncmd ServerPasswordSet"
sleep 5
echo "use this command for check your service status:"
echo "systemctl status vpnserver.service"
}
#run
check_os
check_if_running_as_root
sysup
req
install