| Server IP : 104.129.129.72 / Your IP : 216.73.216.229 Web Server : LiteSpeed System : Linux 123answers 5.15.0-143-generic #153-Ubuntu SMP Fri Jun 13 19:10:45 UTC 2025 x86_64 User : answe8064 ( 1002) PHP Version : 8.2.28 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/cyberpanel/plogical/ |
Upload File : |
#!/usr/local/CyberCP/bin/python
import sys
sys.path.append('/usr/local/CyberCP')
import subprocess, shlex
import os
class UpgradeCritical:
@staticmethod
def executioner(command):
try:
FNULL = open(os.devnull, 'w')
res = subprocess.call(shlex.split(command), stdout=FNULL)
if res == 0:
return 1
else:
return 0
except BaseException as msg:
return 0
@staticmethod
def UpgradeImportantPackages():
if os.path.exists('/etc/lsb-release'):
command = "DEBIAN_FRONTEND=noninteractive apt-get install --only-upgrade pdns-server pdns-backend-mysql install dovecot-imapd dovecot-pop3d postfix-mysql pure-ftpd postfix dovecot-mysql -y"
UpgradeCritical.executioner(command)
else:
command = "yum update"
UpgradeCritical.executioner(command)
command = "yum -y upgrade pdns pdns-backend-mysql pure-ftpd postfix dovecot dovecot-mysql"
UpgradeCritical.executioner(command)
def main():
UpgradeCritical.UpgradeImportantPackages()
if __name__ == "__main__":
main()