mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-15 17:56:12 +01:00
disable repos at appropriate time
This commit is contained in:
@@ -1551,3 +1551,22 @@ pip_virtualenv
|
|||||||
system_tweak
|
system_tweak
|
||||||
|
|
||||||
main_install
|
main_install
|
||||||
|
|
||||||
|
|
||||||
|
### Disable Centos Default Repos
|
||||||
|
|
||||||
|
disable_repos() {
|
||||||
|
|
||||||
|
if [[ $SERVER_OS == "CentOS" ]] ; then
|
||||||
|
sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Base.repo
|
||||||
|
sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Debuginfo.repo
|
||||||
|
sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Media.repo
|
||||||
|
sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Vault.repo
|
||||||
|
sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-CR.repo
|
||||||
|
sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-fasttrack.repo
|
||||||
|
sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Sources.repo
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
disable_repos
|
||||||
@@ -398,6 +398,25 @@ rm -f /usr/local/composer.sh
|
|||||||
|
|
||||||
# clean up
|
# clean up
|
||||||
|
|
||||||
|
### Disable Centos Default Repos
|
||||||
|
|
||||||
|
|
||||||
|
disable_repos() {
|
||||||
|
|
||||||
|
if [[ $SERVER_OS == "CentOS" ]] ; then
|
||||||
|
sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Base.repo
|
||||||
|
sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Debuginfo.repo
|
||||||
|
sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Media.repo
|
||||||
|
sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Vault.repo
|
||||||
|
sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-CR.repo
|
||||||
|
sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-fasttrack.repo
|
||||||
|
sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Sources.repo
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
disable_repos
|
||||||
|
|
||||||
echo "###################################################################"
|
echo "###################################################################"
|
||||||
echo " CyberPanel Upgraded "
|
echo " CyberPanel Upgraded "
|
||||||
echo "###################################################################"
|
echo "###################################################################"
|
||||||
|
|||||||
@@ -2066,31 +2066,6 @@ vmail
|
|||||||
writeToFile.write(content)
|
writeToFile.write(content)
|
||||||
writeToFile.close()
|
writeToFile.close()
|
||||||
|
|
||||||
def enableDisableRepos(self):
|
|
||||||
|
|
||||||
if self.distro == centos:
|
|
||||||
command = "sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Base.repo"
|
|
||||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
|
||||||
|
|
||||||
command = "sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Debuginfo.repo"
|
|
||||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
|
||||||
|
|
||||||
command = "sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Media.repo"
|
|
||||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
|
||||||
|
|
||||||
command = "sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Vault.repo"
|
|
||||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
|
||||||
|
|
||||||
command = "sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-CR.repo"
|
|
||||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
|
||||||
|
|
||||||
command = "sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-fasttrack.repo"
|
|
||||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
|
||||||
|
|
||||||
command = "sed -i 's|enabled=1|enabled=0|g' /etc/yum.repos.d/CentOS-Sources.repo"
|
|
||||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
parser = argparse.ArgumentParser(description='CyberPanel Installer')
|
parser = argparse.ArgumentParser(description='CyberPanel Installer')
|
||||||
parser.add_argument('publicip', help='Please enter public IP for your VPS or dedicated server.')
|
parser.add_argument('publicip', help='Please enter public IP for your VPS or dedicated server.')
|
||||||
@@ -2238,7 +2213,6 @@ def main():
|
|||||||
|
|
||||||
checks.installCLScripts()
|
checks.installCLScripts()
|
||||||
#checks.disablePackegeUpdates()
|
#checks.disablePackegeUpdates()
|
||||||
checks.enableDisableRepos()
|
|
||||||
logging.InstallLog.writeToFile("CyberPanel installation successfully completed!")
|
logging.InstallLog.writeToFile("CyberPanel installation successfully completed!")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user