44
55SUDO_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-
167DEV=" OFF"
178BRANCH=" stable"
189POSTFIX_VARIABLE=" ON"
@@ -35,6 +26,7 @@ TOTAL_RAM=$(free -m | awk '/Mem\:/ { print $2 }')
3526CENTOS_8=" False"
3627WATCHDOG=" OFF"
3728BRANCH_NAME=" v${TEMP: 12: 3} .${TEMP: 25: 1} "
29+ VIRT_TYPE=" "
3830
3931check_return () {
4032# check previous command result , 0 = ok , non-0 = something wrong.
@@ -110,6 +102,17 @@ echo ${WEBADMIN_PASS} > /etc/cyberpanel/webadmin_passwd
110102chmod 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+
113116check_virtualization () {
114117echo -e " Checking virtualization type..."
115118if hostnamectl | grep " Virtualization: lxc" ; then
@@ -118,6 +121,12 @@ if hostnamectl | grep "Virtualization: lxc" ; then
118121 echo -e " Exiting..."
119122 exit
120123fi
124+
125+ if hostnamectl | grep " Virtualization: openvz" ; then
126+ echo -e " \nOpenVZ detected..."
127+ VIRT_TYPE=" OpenVZ"
128+ openvz_change
129+ fi
121130}
122131
123132license_validation () {
@@ -1122,6 +1131,16 @@ fi
11221131}
11231132
11241133pip_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+
11251144if [[ $DEV == " OFF" ]] ; then
11261145if [[ $SERVER_COUNTRY == " CN" ]] ; then
11271146 mkdir /root/.config
15961615SECONDS=0
15971616install_required
15981617
1618+ openvz_change
1619+
15991620pip_virtualenv
16001621
16011622system_tweak
0 commit comments