-
Notifications
You must be signed in to change notification settings - Fork 30
/
setup
151 lines (132 loc) · 6.35 KB
/
setup
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
#!/bin/sh
if [ $(id -u) != "0" ]; then
echo "Co loi: Ban phai dang nhap bang user root!"
exit
fi
if [ -f /var/cpanel/cpanel.config ]; then
echo "Server cua ban da cai san WHM/Cpanel, neu ban muon dung ECHBAY-VPSSIM"
echo "Hay cai moi lai he dieu hanh, khuyen dung CentOS 8 - 64bit"
echo "Chao tam biet !"
exit
fi
if [ -f /etc/psa/.psa.shadow ]; then
echo "Server cua ban da cai san Plesk, neu ban muon dung ECHBAY-VPSSIM"
echo "Hay cai moi lai he dieu hanh, khuyen dung CentOS 8 - 64bit"
echo "Chao tam biet !"
exit
fi
if [ -f /etc/init.d/directadmin ]; then
echo "Server cua ban da cai san DirectAdmin, neu ban muon dung ECHBAY-VPSSIM"
echo "Hay cai moi lai he dieu hanh, khuyen dung CentOS 8 - 64bit"
echo "Chao tam biet !"
exit
fi
if [ -f /etc/init.d/webmin ]; then
echo "Server cua ban da cai san webmin, neu ban muon dung ECHBAY-VPSSIM"
echo "Hay cai moi lai he dieu hanh, khuyen dung CentOS 8 - 64bit"
echo "Chao tam biet !"
exit
fi
if [ -f /home/vpssim.conf ]; then
clear
echo "========================================================================="
echo "========================================================================="
echo "Server/VPS cua ban da cai san ECHBAY-VPSSIM"
echo "Hay su dung lenh ECHBAY-VPSSIM de truy cap ECHBAY-VPSSIM menu"
echo "Chao tam biet !"
echo "========================================================================="
echo "========================================================================="
rm -rf install*
exit
fi
arch=`uname -m`
if [ ! "$arch" = "x86_64" ]; then
clear
echo "========================================================================="
echo "========================================================================="
echo "Hien tai! ECHBAY-VPSSIM chi ho tro phien ban x64 bit"
echo "Vui long cai dat phien ban he dieu hanh x86_64 roi thu lai"
echo "Chao tam biet !"
echo "========================================================================="
echo "========================================================================="
rm -rf install*
exit
fi
if [ -f /etc/yum.repos.d/epel.repo ]; then
sudo sed -i "s/mirrorlist=https/mirrorlist=http/" /etc/yum.repos.d/epel.repo
fi
#wget -q https://vpssim.echbay.com/script/vpssim/calc -O /bin/calc && chmod +x /bin/calc
if [ ! -f /tmp/calc ]; then
yes | cp -rf /bin/calc /tmp/calc && chmod +x /tmp/calc
fi
yes | cp -rf /opt/echbay_vpssim/script/vpssim/calc /bin/calc && chmod +x /bin/calc
clear
rm -rf /root/vpssim*
#prompt="Nhap lua chon cua ban: "
#options=("Tieng Viet" "Tieng Anh" "Huy Bo")
echo "========================================================================="
echo "ECHBAY-VPSSIM Ho Tro CentOS 7, 8 , 9 & AlmaLinux 8, 9 x64"
echo "-------------------------------------------------------------------------"
echo "Ban nen su dung CentOS 9 hoac AlmaLinux 9 x64 de co hieu suat tot nhat."
echo "-------------------------------------------------------------------------"
#echo "ECHBAY-VPSSIM ho tro 2 ngon ngu: Tieng Anh va Tieng Viet. "
#echo "-------------------------------------------------------------------------"
#echo "Trong qua trinh su dung, ban co the thay doi ngon ngu ngon ngu bang chuc "
#echo "-------------------------------------------------------------------------"
#echo "nang [ Change ECHBAY-VPSSIM Language ] trong [ Update System ]."
#echo "========================================================================="
#echo " Chon Ngon Ngu Cho ECHBAY-VPSSIM"
echo "========================================================================="
#PS3="$prompt"
#select opt in "${options[@]}"; do
#case "$REPLY" in
#1) yourlanguage="vietnamese"; break;;
#2) yourlanguage="english"; break;;
#3) yourlanguage="Cancel"; break;;
#*) echo "Ban nhap sai, vui long nhap theo so thu tu trong danh sach";continue;;
#esac
#done
yourlanguage="vietnamese"
current_os_version=$(rpm -q --qf "%{VERSION}" $(rpm -q --whatprovides redhat-release))
#echo $current_os_version
cd ~
if [ "$yourlanguage" = "english" ]; then
echo "----------------------------------------------------------------------------"
echo "Please wait ..."
sleep 2
#wget -q --no-check-certificate https://vpssim.com/script/vpssim/centos${current_os_version}/vpssim-setup && chmod +x vpssim-setup && clear && ./vpssim-setup
#wget -q --no-check-certificate https://vpssim.echbay.com/script/vpssim/centos${current_os_version}/vpssim-setup && chmod +x vpssim-setup && clear && ./vpssim-setup
cd /opt/echbay_vpssim/script/vpssim/centos${current_os_version} ; chmod +x vpssim-setup ; clear ; bash vpssim-setup
yes | cp -rf /opt/echbay_vpssim/script/vpssim/centos${current_os_version}/vpssim-setup ~/vpssim-setup ; chmod +x vpssim-setup ; clear ; bash vpssim-setup
elif [ "$yourlanguage" = "vietnamese" ]; then
echo "----------------------------------------------------------------------------"
echo "Please wait ..."
sleep 2
#
if [ "$current_os_version" == "6" ]; then
#yes | cp -rf /opt/echbay_vpssim/script/vpssim/centos6/vpssim-setup ~/vpssim-setup ; chmod +x vpssim-setup ; clear ; bash vpssim-setup
# dừng hỗ trợ centos6
rm -rf /root/install* && rm -rf /tmp/install* && rm -rf /root/vpssim* && clear
echo "OS version not support: "$current_os_version
exit
elif [ "$current_os_version" == "7" ]; then
yes | cp -rf /opt/echbay_vpssim/script/vpssim/centos7/vpssim-setup ~/vpssim-setup ; chmod +x vpssim-setup ; clear ; bash vpssim-setup
else
# copy lai file calc -> centos8, 9 không hoạt động do thiếu hàm bc
yes | cp -rf /tmp/calc /bin/calc && chmod +x /bin/calc
current_os_version=$(rpm --eval '%{centos_ver}')
#echo $current_os_version
# centos8 dùng chung script với centos9
if [ "$current_os_version" == "8" ] || [ "$current_os_version" == "9" ]; then
yes | cp -rf /opt/echbay_vpssim/script/vpssim/centos9/vpssim-setup ~/vpssim-setup ; chmod +x vpssim-setup ; clear ; bash vpssim-setup
#elif [ "$current_os_version" == "8" ]; then
#yes | cp -rf /opt/echbay_vpssim/script/vpssim/centos8/vpssim-setup ~/vpssim-setup ; chmod +x vpssim-setup ; clear ; bash vpssim-setup
else
rm -rf /root/install* && rm -rf /tmp/install* && rm -rf /root/vpssim* && clear
echo "OS version not support: "$current_os_version
exit
fi
fi
else
rm -rf /root/install* && rm -rf /tmp/install* && rm -rf /root/vpssim* && clear
fi