diff --git a/CPScripts/EasyEngine/EasyEngine-migration.sh b/CPScripts/EasyEngine/EasyEngine-migration.sh index c029e5e8b..81357b083 100644 --- a/CPScripts/EasyEngine/EasyEngine-migration.sh +++ b/CPScripts/EasyEngine/EasyEngine-migration.sh @@ -329,8 +329,16 @@ fi install_lscwp() { ssh_v="ssh -o StrictHostKeyChecking=no root@$server_ip -p$server_port -i /root/.ssh/cyberpanel_migration_key" + +$ssh_v "ls -l /usr/bin/wp" +if [[ $? != "0" ]] ; then + $ssh_v "$sudoer wget -O /usr/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar" + $ssh_v "$sudoer chmod +x /usr/bin/wp" +fi +#install WP CLI if not yet installed. $ssh_v "sudo -u $owner_user -i -- wp --path=/home/${domains[$i]}/public_html plugin install litespeed-cache" echo -e "\nInstalling LiteSpeed Cache for WordPress..." + } export_database() { @@ -397,6 +405,16 @@ echo -e "\nNo file on this server will be touched.\n" read -rsn1 -p "Please press any key to continue..." } +db_length_check() { + ssh_v="ssh -o StrictHostKeyChecking=no root@$server_ip -p$server_port -i /root/.ssh/cyberpanel_migration_key" + output=$($ssh_v "$sudoer cat /usr/local/CyberCP/plogical/mysqlUtilities.py") + if echo $output | grep -q "should be 16 at max" ; then + echo -e "\nPlease upgrade your CyberPanel to latest first..." + clean_up + exit + fi +} + check_dir #check if this is an easyengine server and create a temp dir for storing files during the process. @@ -429,9 +447,10 @@ echo -e "\n\nchecking necessary package..." fi fetch_cyberpanel_key - #function to get cyberpanel server key so future SSH command won't require password input. +db_length_check + tLen=${#domains[@]} #get the domain list and number of domains. diff --git a/cyberpanel.sh b/cyberpanel.sh index 053feece6..88806ed50 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -110,19 +110,33 @@ if [[ $VIRT_TYPE == "OpenVZ" ]] ; then PIDFile=/run/pure-ftpd.pid" > /etc/systemd/system/pure-ftpd.service.d/override.conf echo -e "PureFTPd service file modified for OpenVZ..." fi + + if [[ ! -d /etc/systemd/system/lshttpd.service.d ]] ; then + mkdir /etc/systemd/system/lshttpd.service.d + echo "[Service] +PIDFile=/tmp/lshttpd/lshttpd.pid" > /etc/systemd/system/lshttpd.service.d/override.conf + echo -e "LiteSPeed service file modified for OpenVZ..." + fi + + if [[ ! -d /etc/systemd/system/spamassassin.service.d ]] ; then + mkdir /etc/systemd/system/spamassassin.service.d + echo "[Service] +PIDFile=/run/spamassassin.pid" > /etc/systemd/system/spamassassin.service.d/override.conf + echo -e "SpamAssassin service file modified for OpenVZ..." + fi fi } check_virtualization() { echo -e "Checking virtualization type..." -if hostnamectl | grep "Virtualization: lxc" ; then +if hostnamectl | grep -q "Virtualization: lxc" ; then echo -e "\nLXC detected..." echo -e "CyberPanel does not support LXC" echo -e "Exiting..." exit fi -if hostnamectl | grep "Virtualization: openvz" ; then +if hostnamectl | grep -q "Virtualization: openvz" ; then echo -e "\nOpenVZ detected..." VIRT_TYPE="OpenVZ" openvz_change @@ -1358,8 +1372,8 @@ if [[ ! -f /usr/local/lsws/lsphp74/lib64/php/modules/zip.so ]] && [[ $SERVER_OS if [[ $? == "0" ]] ; then yum remove -y libzip-devel fi - yum install -y http://packages.psychotic.ninja/7/plus/x86_64/RPMS/libzip-0.11.2-6.el7.psychotic.x86_64.rpm - yum install -y http://packages.psychotic.ninja/7/plus/x86_64/RPMS/libzip-devel-0.11.2-6.el7.psychotic.x86_64.rpm + yum install -y https://$DOWNLOAD_SERVER/libzip-0.11.2-6.el7.psychotic.x86_64.rpm + yum install -y https://$DOWNLOAD_SERVER/misc/libzip-devel-0.11.2-6.el7.psychotic.x86_64.rpm /usr/local/lsws/lsphp74/bin/pecl install zip echo "extension=zip.so" > /usr/local/lsws/lsphp74/etc/php.d/20-zip.ini chmod 755 /usr/local/lsws/lsphp74/lib64/php/modules/zip.so @@ -1621,4 +1635,4 @@ pip_virtualenv system_tweak -main_install \ No newline at end of file +main_install diff --git a/cyberpanel_upgrade.sh b/cyberpanel_upgrade.sh index 9dca4e3a6..afc2556f2 100644 --- a/cyberpanel_upgrade.sh +++ b/cyberpanel_upgrade.sh @@ -227,8 +227,8 @@ if [[ ! -f /usr/local/lsws/lsphp74/lib64/php/modules/zip.so ]] && [[ $SERVER_OS yum remove -y libzip-devel fi - yum install -y http://packages.psychotic.ninja/7/plus/x86_64/RPMS/libzip-0.11.2-6.el7.psychotic.x86_64.rpm - yum install -y http://packages.psychotic.ninja/7/plus/x86_64/RPMS/libzip-devel-0.11.2-6.el7.psychotic.x86_64.rpm + yum install -y https://cdn.cyberpanel.sh/misc/libzip-0.11.2-6.el7.psychotic.x86_64.rpm + yum install -y https://cdn.cyberpanel.sh/misc/libzip-devel-0.11.2-6.el7.psychotic.x86_64.rpm yum install lsphp74-devel if [[ ! -d /usr/local/lsws/lsphp74/tmp ]] ; then