Skip to content

Commit 8e61453

Browse files
committed
openvz centos 7 pure-ftpd issue
1 parent 0bcca16 commit 8e61453

File tree

1 file changed

+30
-9
lines changed

1 file changed

+30
-9
lines changed

cyberpanel.sh

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,6 @@
44

55
SUDO_TEST=$(set)
66

7-
export LC_CTYPE=en_US.UTF-8
8-
export LC_ALL=en_US.UTF-8
9-
if [[ $? != "0" ]] ; then
10-
apt upgrade
11-
DEBIAN_FRONTEND=noninteractive apt install -y locales
12-
locale-gen "en_US.UTF-8"
13-
update-locale LC_ALL="en_US.UTF-8"
14-
fi
15-
167
DEV="OFF"
178
BRANCH="stable"
189
POSTFIX_VARIABLE="ON"
@@ -35,6 +26,7 @@ TOTAL_RAM=$(free -m | awk '/Mem\:/ { print $2 }')
3526
CENTOS_8="False"
3627
WATCHDOG="OFF"
3728
BRANCH_NAME="v${TEMP:12:3}.${TEMP:25:1}"
29+
VIRT_TYPE=""
3830

3931
check_return() {
4032
#check previous command result , 0 = ok , non-0 = something wrong.
@@ -110,6 +102,17 @@ echo ${WEBADMIN_PASS} > /etc/cyberpanel/webadmin_passwd
110102
chmod 600 /etc/cyberpanel/webadmin_passwd
111103
}
112104

105+
openvz_change() {
106+
if [[ $VIRT_TYPE == "OpenVZ" ]] ; then
107+
if [[ ! -d /etc/systemd/system/pure-ftpd.service.d ]] ; then
108+
mkdir /etc/systemd/system/pure-ftpd.service.d
109+
echo "[Service]
110+
PIDFile=/run/pure-ftpd.pid" > /etc/systemd/system/pure-ftpd.service.d/override.conf
111+
echo -e "PureFTPd service file modified for OpenVZ..."
112+
fi
113+
fi
114+
}
115+
113116
check_virtualization() {
114117
echo -e "Checking virtualization type..."
115118
if hostnamectl | grep "Virtualization: lxc" ; then
@@ -118,6 +121,12 @@ if hostnamectl | grep "Virtualization: lxc" ; then
118121
echo -e "Exiting..."
119122
exit
120123
fi
124+
125+
if hostnamectl | grep "Virtualization: openvz" ; then
126+
echo -e "\nOpenVZ detected..."
127+
VIRT_TYPE="OpenVZ"
128+
openvz_change
129+
fi
121130
}
122131

123132
license_validation() {
@@ -1122,6 +1131,16 @@ fi
11221131
}
11231132

11241133
pip_virtualenv() {
1134+
if [[ $SERVER_OS == "Ubuntu" ]] ; then
1135+
DEBIAN_FRONTEND=noninteractive apt install -y locales
1136+
locale-gen "en_US.UTF-8"
1137+
update-locale LC_ALL="en_US.UTF-8"
1138+
fi
1139+
1140+
export LC_CTYPE=en_US.UTF-8
1141+
export LC_ALL=en_US.UTF-8
1142+
#need to set lang to address some pip module installation issue.
1143+
11251144
if [[ $DEV == "OFF" ]] ; then
11261145
if [[ $SERVER_COUNTRY == "CN" ]] ; then
11271146
mkdir /root/.config
@@ -1596,6 +1615,8 @@ fi
15961615
SECONDS=0
15971616
install_required
15981617

1618+
openvz_change
1619+
15991620
pip_virtualenv
16001621

16011622
system_tweak

0 commit comments

Comments
 (0)