mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 05:45:59 +01:00
refactor instal/upgrade process
This commit is contained in:
@@ -406,19 +406,9 @@ elif [[ $CENTOS_8 == "False" ]] ; then
|
|||||||
curl https://raw.githubusercontent.com/usmannasir/cyberpanel/v2.0.1/install/CyberPanel.repo > /etc/yum.repos.d/CyberPanel.repo
|
curl https://raw.githubusercontent.com/usmannasir/cyberpanel/v2.0.1/install/CyberPanel.repo > /etc/yum.repos.d/CyberPanel.repo
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $SERVER_COUNTRY == "CN" ]] ; then
|
|
||||||
mkdir /root/.config
|
|
||||||
mkdir /root/.config/pip
|
|
||||||
cat << EOF > /root/.config/pip/pip.conf
|
|
||||||
[global]
|
|
||||||
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
|
|
||||||
[install]
|
|
||||||
trusted-host=pypi.tuna.tsinghua.edu.cn
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo -e "\nInstalling necessary components..."
|
echo -e "\nInstalling necessary components..."
|
||||||
if [[ $SERVER_OS == "CentOS" ]] ; then
|
if [[ $SERVER_OS == "CentOS" ]] ; then
|
||||||
|
|
||||||
timeout 10 rpm --import https://$DOWNLOAD_SERVER/mariadb/RPM-GPG-KEY-MariaDB
|
timeout 10 rpm --import https://$DOWNLOAD_SERVER/mariadb/RPM-GPG-KEY-MariaDB
|
||||||
timeout 10 rpm --import https://$DOWNLOAD_SERVER/litespeed/RPM-GPG-KEY-litespeed
|
timeout 10 rpm --import https://$DOWNLOAD_SERVER/litespeed/RPM-GPG-KEY-litespeed
|
||||||
timeout 10 rpm --import https://$DOWNLOAD_SERVER/powerdns/FD380FBB-pub.asc
|
timeout 10 rpm --import https://$DOWNLOAD_SERVER/powerdns/FD380FBB-pub.asc
|
||||||
@@ -430,7 +420,9 @@ if [[ $SERVER_OS == "CentOS" ]] ; then
|
|||||||
timeout 10 rpm --import https://copr-be.cloud.fedoraproject.org/results/copart/restic/pubkey.gpg
|
timeout 10 rpm --import https://copr-be.cloud.fedoraproject.org/results/copart/restic/pubkey.gpg
|
||||||
timeout 10 rpm --import https://rep8.cyberpanel.net/RPM-GPG-KEY-CP-EP-8
|
timeout 10 rpm --import https://rep8.cyberpanel.net/RPM-GPG-KEY-CP-EP-8
|
||||||
timeout 10 rpm --import https://rep8.cyberpanel.net/RPM-GPG-KEY-CP-GF-8
|
timeout 10 rpm --import https://rep8.cyberpanel.net/RPM-GPG-KEY-CP-GF-8
|
||||||
|
timeout 10 rpm --import https://rep8.cyberpanel.net/RPM-GPG-KEY-centosofficialcp
|
||||||
curl https://getfedora.org/static/fedora.gpg | gpg --import
|
curl https://getfedora.org/static/fedora.gpg | gpg --import
|
||||||
|
|
||||||
yum clean all
|
yum clean all
|
||||||
yum update -y
|
yum update -y
|
||||||
yum autoremove epel-release -y
|
yum autoremove epel-release -y
|
||||||
@@ -438,27 +430,18 @@ if [[ $SERVER_OS == "CentOS" ]] ; then
|
|||||||
rm -f /etc/yum.repos.d/epel.repo.rpmsave
|
rm -f /etc/yum.repos.d/epel.repo.rpmsave
|
||||||
|
|
||||||
if [[ $CENTOS_8 == "False" ]] ; then
|
if [[ $CENTOS_8 == "False" ]] ; then
|
||||||
yum --enablerepo=CyberPanel install -y wget strace htop net-tools telnet curl which bc telnet htop libevent-devel gcc libattr-devel xz-devel gpgme-devel curl-devel git socat openssl-devel MariaDB-shared mariadb-devel
|
yum --enablerepo=CyberPanel install -y wget strace htop net-tools telnet curl which bc telnet htop libevent-devel gcc libattr-devel xz-devel gpgme-devel curl-devel git socat openssl-devel MariaDB-shared mariadb-devel yum-utils python36u python36u-pip python36u-devel
|
||||||
|
check_return
|
||||||
|
yum -y groupinstall development
|
||||||
check_return
|
check_return
|
||||||
fi
|
fi
|
||||||
if [[ $CENTOS_8 == "True" ]] ; then
|
if [[ $CENTOS_8 == "True" ]] ; then
|
||||||
dnf install -y wget strace htop net-tools telnet curl which bc telnet htop libevent-devel gcc libattr-devel xz-devel mariadb-devel curl-devel git platform-python-devel tar socat
|
dnf install -y wget strace htop net-tools telnet curl which bc telnet htop libevent-devel gcc libattr-devel xz-devel mariadb-devel curl-devel git platform-python-devel tar socat python3
|
||||||
check_return
|
check_return
|
||||||
dnf --enablerepo=PowerTools install gpgme-devel -y
|
dnf --enablerepo=PowerTools install gpgme-devel -y
|
||||||
check_return
|
check_return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $DEV == "ON" ]] ; then
|
|
||||||
if [[ $CENTOS_8 == "False" ]] ; then
|
|
||||||
yum -y install yum-utils
|
|
||||||
yum -y groupinstall development
|
|
||||||
yum -y install python36u python36u-pip python36u-devel
|
|
||||||
check_return
|
|
||||||
fi
|
|
||||||
if [[ $CENTOS_8 == "True" ]] ; then
|
|
||||||
dnf install python3 -y
|
|
||||||
check_return
|
|
||||||
fi
|
|
||||||
if [[ $SERVER_OS == "CentOS" ]] ; then
|
if [[ $SERVER_OS == "CentOS" ]] ; then
|
||||||
pip3.6 install virtualenv==16.7.9
|
pip3.6 install virtualenv==16.7.9
|
||||||
else
|
else
|
||||||
@@ -466,7 +449,6 @@ if [[ $DEV == "ON" ]] ; then
|
|||||||
fi
|
fi
|
||||||
check_return
|
check_return
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $SERVER_OS == "Ubuntu" ]] ; then
|
if [[ $SERVER_OS == "Ubuntu" ]] ; then
|
||||||
apt update -y
|
apt update -y
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ SERVER_COUNTRY=$(curl --silent --max-time 5 https://cyberpanel.sh/?country)
|
|||||||
|
|
||||||
### Update and remove not needed repos
|
### Update and remove not needed repos
|
||||||
|
|
||||||
curl https://raw.githubusercontent.com/usmannasir/cyberpanel/v2.0.1/install/CyberPanel.repo > /etc/yum.repos.d/CyberPanel.repo
|
|
||||||
rm -f /etc/yum.repos.d/ius-archive.repo
|
rm -f /etc/yum.repos.d/ius-archive.repo
|
||||||
rm -f /etc/yum.repos.d/copart-restic-epel-7.repo
|
rm -f /etc/yum.repos.d/copart-restic-epel-7.repo
|
||||||
rm -f /etc/yum.repos.d/dovecot.repo
|
rm -f /etc/yum.repos.d/dovecot.repo
|
||||||
@@ -29,6 +28,7 @@ rm -f /etc/yum.repos.d/gf.repo
|
|||||||
rm -f /etc/yum.repos.d/powerdns-auth-42.repo
|
rm -f /etc/yum.repos.d/powerdns-auth-42.repo
|
||||||
rm -rf /etc/yum.repos.d/powerdns-auth-master.repo
|
rm -rf /etc/yum.repos.d/powerdns-auth-master.repo
|
||||||
rm -rf /etc/yum.repos.d/gf.repo.rpmnew
|
rm -rf /etc/yum.repos.d/gf.repo.rpmnew
|
||||||
|
rm -rf /etc/yum.repos.d/CentOS-AppStream.repo
|
||||||
yum clean all
|
yum clean all
|
||||||
yum update -y
|
yum update -y
|
||||||
yum autoremove epel-release -y
|
yum autoremove epel-release -y
|
||||||
@@ -168,14 +168,17 @@ OUTPUT=$(cat /etc/*release)
|
|||||||
if echo $OUTPUT | grep -q "CentOS Linux 7" ; then
|
if echo $OUTPUT | grep -q "CentOS Linux 7" ; then
|
||||||
echo -e "\nDetecting CentOS 7.X...\n"
|
echo -e "\nDetecting CentOS 7.X...\n"
|
||||||
SERVER_OS="CentOS7"
|
SERVER_OS="CentOS7"
|
||||||
|
curl https://raw.githubusercontent.com/usmannasir/cyberpanel/v2.0.1/install/CyberPanel.repo > /etc/yum.repos.d/CyberPanel.repo
|
||||||
yum clean all
|
yum clean all
|
||||||
yum update -y
|
yum update -y
|
||||||
elif echo $OUTPUT | grep -q "CloudLinux 7" ; then
|
elif echo $OUTPUT | grep -q "CloudLinux 7" ; then
|
||||||
echo -e "\nDetecting CloudLinux 7.X...\n"
|
echo -e "\nDetecting CloudLinux 7.X...\n"
|
||||||
SERVER_OS="CentOS7"
|
SERVER_OS="CentOS7"
|
||||||
|
curl https://raw.githubusercontent.com/usmannasir/cyberpanel/v2.0.1/install/CyberPanel.repo > /etc/yum.repos.d/CyberPanel.repo
|
||||||
yum clean all
|
yum clean all
|
||||||
yum update -y
|
yum update -y
|
||||||
elif echo $OUTPUT | grep -q "CentOS Linux 8" ; then
|
elif echo $OUTPUT | grep -q "CentOS Linux 8" ; then
|
||||||
|
curl https://raw.githubusercontent.com/usmannasir/cyberpanel/v2.0.1/install/CyberPanel8.repo > /etc/yum.repos.d/CyberPanel.repo
|
||||||
echo -e "\nDetecting CentOS 8.X...\n"
|
echo -e "\nDetecting CentOS 8.X...\n"
|
||||||
SERVER_OS="CentOS8"
|
SERVER_OS="CentOS8"
|
||||||
yum clean all
|
yum clean all
|
||||||
@@ -193,9 +196,9 @@ fi
|
|||||||
if [ $SERVER_OS = "CentOS7" ] ; then
|
if [ $SERVER_OS = "CentOS7" ] ; then
|
||||||
yum -y install yum-utils
|
yum -y install yum-utils
|
||||||
yum -y groupinstall development
|
yum -y groupinstall development
|
||||||
yum -y install python36u python36u-pip python36u-devel openssl-devel MariaDB-shared mariadb-devel
|
yum --enablerepo=CyberPanel install -y wget strace htop net-tools telnet curl which bc telnet htop libevent-devel gcc libattr-devel xz-devel gpgme-devel curl-devel git socat openssl-devel MariaDB-shared mariadb-devel
|
||||||
elif [ $SERVER_OS = "CentOS8" ] ; then
|
elif [ $SERVER_OS = "CentOS8" ] ; then
|
||||||
yum install -y wget strace htop net-tools telnet curl which bc telnet htop libevent-devel gcc libattr-devel xz-devel mariadb-devel curl-devel git platform-python-devel tar
|
dnf install -y wget strace htop net-tools telnet curl which bc telnet htop libevent-devel gcc libattr-devel xz-devel mariadb-devel curl-devel git platform-python-devel tar socat
|
||||||
dnf --enablerepo=PowerTools install gpgme-devel -y
|
dnf --enablerepo=PowerTools install gpgme-devel -y
|
||||||
dnf install python3 -y
|
dnf install python3 -y
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -1932,7 +1932,7 @@ milter_default_action = accept
|
|||||||
if self.distro == centos:
|
if self.distro == centos:
|
||||||
command = 'yum --enablerepo=CyberPanel install restic -y'
|
command = 'yum --enablerepo=CyberPanel install restic -y'
|
||||||
else:
|
else:
|
||||||
command = 'dnf --enablerepo=CyberPanel install restic -y'
|
command = 'dnf --enablerepo=CyberPanel install restic -y --nogpgcheck'
|
||||||
|
|
||||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user