!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/5.6.40 

uname -a: Linux cpanel06wh.bkk1.cloud.z.com 2.6.32-954.3.5.lve1.4.80.el6.x86_64 #1 SMP Thu Sep 24
01:42:00 EDT 2020 x86_64
 

uid=851(cp949260) gid=853(cp949260) groups=853(cp949260) 

Safe-mode: OFF (not secure)

/opt/alt/python37/lib/python3.7/site-packages/clconfigure/   drwxr-xr-x
Free 234 GB of 981.82 GB (23.83%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     packages.py (2.02 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
# Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2018 All Rights Reserved
#
# Licensed under CLOUD LINUX LICENSE AGREEMENT
# https://cloudlinux.com/docs/LICENCE.TXT
#
from __future__ import absolute_import
import logging
import os
import re
from clconfigure import task, run

STATE_REMOVED = 'uninstalled'
STATE_INSTALLED = 'installed'

_PACKAGE_NOT_INSTALLED = 'is not installed'


@task("Changing package '{package_name}' state to '{desired_state}'")
def set_package_state(desired_state, package_name):
    """
    Brings package to given state (installed | uninstalled). May be executed more that once,
    does't crash on future calls
    """
    current_state = _get_package_state(package_name)
    logging.debug("Checking package '%s' state... package is in state '%s'", package_name, current_state)

    if desired_state == current_state:
        logging.debug("No actions needed for package '%s'", package_name)
        return

    logging.info('State does not match target, changing...')
    if desired_state == STATE_REMOVED:
        action = 'remove'
    elif desired_state == STATE_INSTALLED:
        action = 'install'
    else:
        raise NotImplementedError()

    run(['yum', action, '-y', package_name])
    current_state = _get_package_state(package_name)
    logging.info("Checking package '%s' state again... package is now in state '%s'", package_name, current_state)
    if desired_state != current_state:
        raise RuntimeError("Failed to do required actions")


def _get_package_state(package):
    """
    Gets current package state.
    Either installed or uninstalled.
    """
    resp = run(['rpm', '-q', package])
    if _PACKAGE_NOT_INSTALLED in resp.stdout:
        return STATE_REMOVED
    elif resp.exitcode == 0:
        return STATE_INSTALLED
    raise RuntimeError('Unknown package %s status' % package)


def get_list_installed_alt_phps():
    """
    Gets installed alt-phps
    return: list ['php44', 'php54', 'php80']
    """
    return [php for php in os.listdir('/opt/alt') if re.match(r'^php\d+$', php)]

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0254 ]--