-
Notifications
You must be signed in to change notification settings - Fork 1
/
install
90 lines (75 loc) · 2.33 KB
/
install
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
#!/bin/bash
#######################################################
# SurVPS Script Installer v1.0.2
#######################################################
source /etc/os-release
VERSION_ID=(${VERSION_ID//./ })
OS_VERSION="$ID$VERSION_ID"
if [ -f "/usr/bin/yum" ] && [ -d "/etc/yum.repos.d" ]; then
PM="yum"
elif [ -f "/usr/bin/apt" ] && [ -f "/usr/bin/dpkg" ]; then
PM="apt"
fi
if [ $(id -u) != "0" ]; then
echo "You need to be root to perform this command. Run \"sudo su\" to become root!"
exit
fi
if [ -f /var/cpanel/cpanel.config ]; then
clear
echo "Your server installed WHM/Cpanel, please reinstall to use SurVPS Script."
exit
fi
if [ -f /etc/psa/.psa.shadow ]; then
clear
echo "Your server installed Plesk, please reinstall to use SurVPS Script."
exit
fi
if [ -f /etc/init.d/directadmin ]; then
clear
echo "Your server installed DirectAdmin, please reinstall to use SurVPS Script."
exit
fi
if [ -f /etc/init.d/webmin ]; then
clear
echo "Your server installed Webmin, please reinstall to use SurVPS Script."
exit
fi
if [[ -z "$(cat /etc/resolv.conf)" ]]; then
echo ""
echo "/etc/resolv.conf is empty. No nameserver resolvers detected !! "
echo "Please configure your /etc/resolv.conf correctly or you will not"
echo "be able to use the internet or download from your server."
echo "aborting script... please re-run install"
echo ""
exit
fi
if [ "$OS_VERSION" != "centos6" ] && [ "$OS_VERSION" != "ubuntu20" ]; then
echo "SurVPS Script is only compatible with CentOS 7 or Ubuntu 20"
echo "Goodbye!"
exit
fi
ACTION_FOLDER=/root/survps
if [ -d "$ACTION_FOLDER" ]; then
rm -rf $ACTION_FOLDER
fi
if [ -f /etc/survps/scripts.conf ]; then
echo "========================================================================="
echo "Server/VPS cua ban da cai san SurVPS"
echo "Hay su dung lenh sur de truy cap menu quan ly"
echo "Chao tam biet!"
echo "========================================================================="
exit
fi
if [ "$PM" == "yum" ];then
yum install wget unzip -y
elif [ "${PM}" == "apt" ];then
apt install wget unzip -y
fi
mkdir -p $ACTION_FOLDER
cd $ACTION_FOLDER
wget https://f97.github.io/survps/sur.zip --no-check-certificate
A | unzip sur.zip
cp -rf survps/* .
rm -rf sur*
rm -f /root/install*
bash $ID