From 2f41cdbc16789d25b220bd81592e52d15369296c Mon Sep 17 00:00:00 2001 From: qtwrk Date: Tue, 11 Feb 2020 17:16:51 +0100 Subject: [PATCH] DB name/user length check --- CPScripts/EasyEngine/EasyEngine-migration.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/CPScripts/EasyEngine/EasyEngine-migration.sh b/CPScripts/EasyEngine/EasyEngine-migration.sh index c029e5e8b..d807447ca 100644 --- a/CPScripts/EasyEngine/EasyEngine-migration.sh +++ b/CPScripts/EasyEngine/EasyEngine-migration.sh @@ -397,6 +397,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 +439,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.