403Webshell
Server IP : 104.21.17.213  /  Your IP : 216.73.217.141
Web Server : Apache
System : Linux hosting01.arsenalhost.com 4.18.0-425.13.1.lve.el8.x86_64 #1 SMP Mon Feb 27 15:23:24 EST 2023 x86_64
User : corbizre ( 1013)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
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