From 5c87a7c32e3a5424dbcef58cb62adb16dae067eb Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Mon, 11 May 2020 01:03:51 +0500 Subject: [PATCH] ubuntu 20 --- cyberpanel.sh | 10 +++++++++- install/installCyberPanel.py | 37 ++++++++++++++++++++++++++++-------- 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/cyberpanel.sh b/cyberpanel.sh index 492668dcd..9ca9bbe12 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -554,7 +554,7 @@ elif echo $OUTPUT | grep -q "CentOS Linux 8" ; then echo -e "\nDetecting CentOS 8.X...\n" SERVER_OS="CentOS" CENTOS_8="True" -elif echo $OUTPUT | grep -q "Ubuntu" ; then +elif echo $OUTPUT | grep -q "Ubuntu 18.04" ; then if uname -m | grep -q 64 ; then echo -e "\nDetecting Ubuntu 18.04...\n" SERVER_OS="Ubuntu" @@ -562,6 +562,14 @@ elif echo $OUTPUT | grep -q "Ubuntu" ; then echo -e "\nUbuntu 18.04 x32 detected...ths only works on x64 system." exit fi +elif echo $OUTPUT | grep -q "Ubuntu 20" ; then + if uname -m | grep -q 64 ; then + echo -e "\nDetecting Ubuntu 20...\n" + SERVER_OS="Ubuntu" + else + echo -e "\nUbuntu 20 x32 detected...ths only works on x64 system." + exit + fi else cat /etc/*release echo -e "\nUnable to detect your OS...\n" diff --git a/install/installCyberPanel.py b/install/installCyberPanel.py index bba011f20..80019cbd1 100755 --- a/install/installCyberPanel.py +++ b/install/installCyberPanel.py @@ -7,12 +7,32 @@ import randomPassword import errno import MySQLdb as mariadb import install +from os.path import exists #distros centos=0 ubuntu=1 cent8=2 +def get_Ubuntu_release(): + release = -1 + if exists("/etc/lsb-release"): + distro_file = "/etc/lsb-release" + with open(distro_file) as f: + for line in f: + if line[:16] == "DISTRIB_RELEASE=": + release = float(line[16:]) + + if release == -1: + print("Can't find distro release name in " + distro_file + " - fatal error") + + else: + logging.InstallLog.writeToFile("Can't find linux release file - fatal error") + print("Can't find linux release file - fatal error") + os._exit(os.EX_UNAVAILABLE) + + return release + class InstallCyberPanel: mysql_Root_password = "" @@ -333,17 +353,18 @@ class InstallCyberPanel: command = 'DEBIAN_FRONTEND=noninteractive apt install pure-ftpd-mysql -y' os.system(command) - command = 'wget https://rep.cyberpanel.net/pure-ftpd-common_1.0.47-3_all.deb' - install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) + if get_Ubuntu_release() == 18.10: + command = 'wget https://rep.cyberpanel.net/pure-ftpd-common_1.0.47-3_all.deb' + install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) - command = 'wget https://rep.cyberpanel.net/pure-ftpd-mysql_1.0.47-3_amd64.deb' - install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) + command = 'wget https://rep.cyberpanel.net/pure-ftpd-mysql_1.0.47-3_amd64.deb' + install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) - command = 'dpkg --install --force-confold pure-ftpd-common_1.0.47-3_all.deb' - install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) + command = 'dpkg --install --force-confold pure-ftpd-common_1.0.47-3_all.deb' + install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) - command = 'dpkg --install --force-confold pure-ftpd-mysql_1.0.47-3_amd64.deb' - install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) + command = 'dpkg --install --force-confold pure-ftpd-mysql_1.0.47-3_amd64.deb' + install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) elif self.distro == centos: command = "yum install -y pure-ftpd"