From 1aaaefb3bfa6f4b7d86c3e9439b100c404ef784b Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Thu, 18 Mar 2021 15:20:34 +0500 Subject: [PATCH] fix dovecot upgrade on ubuntu --- cyberpanel_upgrade.sh | 24 +++++++++++++----------- plogical/upgrade.py | 34 +++++++++++++++------------------- 2 files changed, 28 insertions(+), 30 deletions(-) diff --git a/cyberpanel_upgrade.sh b/cyberpanel_upgrade.sh index 212abfaf3..11ce993b9 100644 --- a/cyberpanel_upgrade.sh +++ b/cyberpanel_upgrade.sh @@ -427,17 +427,19 @@ elif [[ "$Server_OS" = "Ubutnu" ]] ; then : #all pre-upgrade operation for Ubuntu 18 elif [[ "$Server_OS_Version" = "20" ]] ; then - if ! grep -q "focal" /etc/apt/sources.list.d/dovecot.list ; then - sed -i 's|ce-2.3-latest/ubuntu/bionic bionic main|ce-2.3-latest/ubuntu/focal focal main|g' /etc/apt/sources.list.d/dovecot.list - rm -rf /etc/dovecot-backup - cp -r /etc/dovecot /etc/dovecot-backup - apt update - DEBIAN_FRONTEND=noninteractive apt -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" remove -y dovecot-mysql dovecot-pop3d dovecot-imapd - DEBIAN_FRONTEND=noninteractive apt -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install -y dovecot-mysql dovecot-pop3d dovecot-imapd - systemctl restart dovecot - fi - #fix ubuntu 20 webmail login issue - +# if ! grep -q "focal" /etc/apt/sources.list.d/dovecot.list ; then +# sed -i 's|ce-2.3-latest/ubuntu/bionic bionic main|ce-2.3-latest/ubuntu/focal focal main|g' /etc/apt/sources.list.d/dovecot.list +# rm -rf /etc/dovecot-backup +# cp -r /etc/dovecot /etc/dovecot-backup +# apt update +# DEBIAN_FRONTEND=noninteractive apt -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" remove -y dovecot-mysql dovecot-pop3d dovecot-imapd +# DEBIAN_FRONTEND=noninteractive apt -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install -y dovecot-mysql dovecot-pop3d dovecot-imapd +# systemctl restart dovecot +# fi + #fix ubuntu 20 webmail login issue + + rm -f /etc/apt/sources.list.d/dovecot.list + apt update fi #all pre-upgrade operation for Ubuntu 20 fi diff --git a/plogical/upgrade.py b/plogical/upgrade.py index b30aacbc3..3f96b7aee 100755 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -2168,25 +2168,21 @@ echo $oConfig->Save() ? 'Done' : 'Error'; elif Upgrade.FindOperatingSytem() == Ubuntu20: debPath = '/etc/apt/sources.list.d/dovecot.list' - writeToFile = open(debPath, 'w') - writeToFile.write('deb https://repo.dovecot.org/ce-2.3-latest/ubuntu/focal focal main\n') - writeToFile.close() - - command = "apt update -y" - Upgrade.executioner(command, command) - - command = 'dpkg --configure -a' - subprocess.call(command, shell=True) - - command = 'apt --fix-broken install -y' - subprocess.call(command, shell=True) - - command = 'DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical apt -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade -y' - subprocess.call(command, shell=True) - - - - + # writeToFile = open(debPath, 'w') + # writeToFile.write('deb https://repo.dovecot.org/ce-2.3-latest/ubuntu/focal focal main\n') + # writeToFile.close() + # + # command = "apt update -y" + # Upgrade.executioner(command, command) + # + # command = 'dpkg --configure -a' + # subprocess.call(command, shell=True) + # + # command = 'apt --fix-broken install -y' + # subprocess.call(command, shell=True) + # + # command = 'DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical apt -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade -y' + # subprocess.call(command, shell=True) dovecotConf = '/etc/dovecot/dovecot.conf'