PATH:
usr
/
bin
#!/opt/cloudlinux/venv/bin/python3 -sbb # # Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2021 All Rights Reserved # # Licensed under CLOUD LINUX LICENSE AGREEMENT # http://cloudlinux.com/docs/LICENCE.TXT # import getopt import os import sys import textwrap import cldetectlib as detect import cllicenselib as cllicense import clsetuplib as clsetup from clcommon.lib.cledition import get_cl_edition_readable, skip_without_lve from clcommon.utils import get_os_version, is_ea4, is_nginx_running # Check for root def check_root(): if os.geteuid() != 0: print("Error: root privileges required. Abort.") sys.exit(-1) # Show help def print_usage() -> None: help_message = """ -h | --help show this message --detect-cp print control panel and its version (CP_NAME, CP_VERSION) --detect-cp-full print control panel, version and panel specific data (CP_NAME, CP_VERSION, ...) Specific data: for ISP Manager5 - Master/Node --detect-cp-nameonly print control panel name (CP_NAME) --get-admin-email print control panel admin email (CP_ADMIN_EMAIL) --cxs-installed check if CXS is installed. Returns 0 if installed, 1 otherwise --cpanel-suphp-enabled check if suPHP is enabled in cPanel. Returns 0 if enabled, 1 otherwise --detect-litespeed check if LiteSpeed is installed. Returns 0 if installed, 1 otherwise --detect-postgresql check if PostGreSQL is installed. Returns 0 if installed, 1 otherwise --detect-ea4 check if EA4 is installed. Only for cPanel --detect-nginx check if nginx is running --print-apache-gid print current apache gid --print-da-admin print DirectAdmin admin user --set-securelinks-gid change sysctl conf if apache gid != 48 (default) --set-nagios do some adjustments to make nagios work correctly if it's installed --setup-supergids do some adjustments to make some software work correctly if it's installed --cl-setup check if CloudLinux is installing. Returns 0 if installing, 1 otherwise --update-license update license --update-new-key update license with new key --check-license check license. Return OK if license is not older than 3 days, error message otherwise --check-license --quiet check license. Exit with code 0 if license is not older than 3 days, 1 otherwise --no-valid-license-screen return 'no valid license found' screen --license-out-of-date-email return the 'license out of date' email --check-openvz return environment ID --detect-edition return edition of CloudLinux --detect-os print OS name and version (OS_NAME,OS_VERSION) --detect-os-nameonly print OS name only (OS_NAME) """ # noqa: E501 # Strip newlines from the start and end # Keep in mind that multi-line indentation is preserved print(help_message.strip("\n")) def update_new_key(key): cllicense.update_license_with_key(key) def check_license(quiet): is_license_valid = cllicense.check_license() if quiet: if is_license_valid: sys.exit(0) else: sys.exit(1) else: print(cllicense.last_license_check(is_license_valid)) sys.exit(0) def main(): try: opts, args = getopt.getopt( sys.argv[1:], "hq", [ "help", "quiet", "detect-cp", "detect-cp-full", "detect-cp-nameonly", "cxs-installed", "cpanel-suphp-enabled", "get-admin-email", "print-apache-gid", "detect-litespeed", "detect-postgresql", "set-securelinks-gid", "print-da-admin", "cl-setup", "set-nagios", "update-license", "update-new-key", "check-license", "no-valid-license-screen", "license-out-of-date-email", "check-openvz", "detect-ea4", "detect-nginx", "setup-supergids", "detect-edition", "detect-os", "detect-os-nameonly", ], ) except getopt.GetoptError: print("error: unknown command") print_usage() sys.exit(1) executed = False quiet = False for option, _argument in opts: if option in ("--quiet", "-q"): quiet = True break skipped_without_lve_checks = ("--set-securelinks-gid", "--set-nagios", "--setup-supergids") for option, _argument in opts: if option in skipped_without_lve_checks: skip_without_lve() if option in ("--help", "-h"): executed = True check_root() print_usage() elif option in ("--cxs-installed",): executed = True check_root() if detect.CXS_check(): sys.exit(0) else: sys.exit(1) elif option in ("--detect-cp",): executed = True check_root() detect.getCP() print(str(detect.CP_NAME) + "," + str(detect.CP_VERSION)) elif option in ("--detect-cp-full",): executed = True check_root() detect.getCP() cp_name = str(detect.CP_NAME) cp_version = str(detect.CP_VERSION) if detect.CP_ISP_TYPE: # Panel additional info present print(f"{cp_name},{cp_version},{detect.CP_ISP_TYPE}") else: # No panel additional info present print(f"{cp_name},{cp_version}") elif option in ("--detect-cp-nameonly",): executed = True check_root() detect.getCPName() print(str(detect.CP_NAME)) elif option in ("--get-admin-email",): executed = True check_root() print(detect.getCPAdminEmail()) elif option in ("--cpanel-suphp-enabled",): executed = True check_root() if detect.mod_suPHP_check(): sys.exit(0) else: sys.exit(1) elif option in ("--detect-litespeed",): executed = True check_root() if detect.detect_litespeed(): sys.exit(0) else: sys.exit(1) elif option in ("--detect-postgresql",): executed = True check_root() if detect.detect_postgresql(): sys.exit(0) else: sys.exit(1) elif option in ("--print-apache-gid",): executed = True check_root() if detect.get_apache_gid(): print(detect.APACHE_GID) else: print("error: unknown control panel") elif option in ("--set-securelinks-gid",): executed = True check_root() if detect.get_apache_gid(): clsetup.set_securelinks_gid(detect.APACHE_GID) # Actually, this command could be removed because it's a sub-set of # --setup-supergids, but I left it here only for backward compatibility elif option in ("--set-nagios",): executed = True check_root() clsetup.setup_nagios() elif option in ("--setup-supergids",): executed = True check_root() clsetup.setup_supergids() elif option in ("--print-da-admin",): executed = True check_root() admin = detect.detect_DA_admin() if admin: print(admin) else: print("Error: can not find admin user for DirectAdmin") elif option in ("--cl-setup",): executed = True check_root() if detect.check_CL_installing(): sys.exit(0) else: sys.exit(1) elif option in ("--update-license",): executed = True check_root() cllicense.update_license_timestamp_file() elif option in ("--update-new-key",): executed = True check_root() try: update_new_key(args[0].strip()) except: print("Error: key required.") sys.exit(1) elif option in ("--check-license",): executed = True check_license(quiet) elif option in ("--no-valid-license-screen",): executed = True check_root() print(cllicense.get_novalid_template()) elif option in ("--license-out-of-date-email",): executed = True check_root() print(cllicense.get_email_template()) elif option in ("--check-openvz",): executed = True result = detect.is_openvz() sys.stdout.write(str(result)) elif option in ("--detect-ea4",): executed = True if is_ea4(): print("EA4 detected") else: print("No EA4 detected") elif option in ("--detect-nginx",): executed = True if is_nginx_running(): print("Nginx is running") else: print("Nginx is not running") elif option in ("--detect-edition",): executed = True print(get_cl_edition_readable()) elif option in ("--detect-os",): executed = True os_name, os_ver = get_os_version() print(os_name, os_ver) elif option in ("--detect-os-nameonly",): executed = True os_name, _ = get_os_version() print(os_name) if not executed: print("error: argument required") print_usage() sys.exit(1) if __name__ == "__main__": main()
[+]
..
[-] fc-cat
[open]
[-] mariadb-access
[open]
[-] pre-grohtml
[open]
[-] echo
[open]
[-] x86_64-redhat-linux-gcc
[open]
[-] composite
[open]
[-] autoreconf
[open]
[-] size
[open]
[-] mkfifo
[open]
[-] libnetcfg
[open]
[-] aclocal-1.16
[open]
[-] diff3
[open]
[-] tar
[open]
[-] precat
[open]
[-] du
[open]
[-] tclsh
[open]
[-] touch
[open]
[-] fc-match
[open]
[-] replace
[open]
[-] gprof
[open]
[-] post-grohtml
[open]
[-] shuf
[open]
[-] zsoelim
[open]
[-] paste
[open]
[-] yes
[open]
[-] chmod
[open]
[-] file
[open]
[-] sum
[open]
[-] more
[open]
[-] pango-view
[open]
[-] gzip
[open]
[-] ldd
[open]
[-] mysqlimport
[open]
[-] montage
[open]
[-] b2sum
[open]
[-] renice
[open]
[-] cal
[open]
[-] perlml
[open]
[-] strip
[open]
[-] dig
[open]
[-] fc-cache
[open]
[-] fold
[open]
[-] scl_source
[open]
[-] rvim
[open]
[-] znew
[open]
[-] git-shell
[open]
[-] gtroff
[open]
[-] fmt
[open]
[-] xsubpp
[open]
[-] passwd
[open]
[-] mailx
[open]
[-] patch
[open]
[-] nm
[open]
[-] isosize
[open]
[-] strings
[open]
[-] gtbl
[open]
[-] gem
[open]
[-] aclocal
[open]
[-] timeout
[open]
[-] python2.7
[open]
[-] h2ph
[open]
[-] curl
[open]
[-] sync
[open]
[-] sftp
[open]
[-] tac
[open]
[-] enchant
[open]
[-] ps2pdf13
[open]
[-] basenc
[open]
[-] vi
[open]
[-] mariadb-find-rows
[open]
[-] flex
[open]
[-] gcc-nm
[open]
[-] mysql_find_rows
[open]
[-] ifnames
[open]
[-] dircolors
[open]
[-] soelim
[open]
[-] ssh-keygen
[open]
[-] xmlwf
[open]
[-] tclsh8.6
[open]
[-] gsnd
[open]
[-] autoconf
[open]
[-] m4
[open]
[-] whoami
[open]
[-] zipinfo
[open]
[-] truncate
[open]
[-] bzdiff
[open]
[-] stat
[open]
[-] head
[open]
[-] gmake
[open]
[-] awk
[open]
[-] ps2ps
[open]
[-] mysqlshow
[open]
[-] crontab.cagefs
[open]
[-] basename
[open]
[-] fc-pattern
[open]
[-] batch
[open]
[-] nroff
[open]
[-] stream
[open]
[-] bzgrep
[open]
[-] piconv
[open]
[-] rmdir
[open]
[-] hexdump
[open]
[-] bunzip2
[open]
[-] xxd
[open]
[-] catchsegv
[open]
[-] grotty
[open]
[-] bzcmp
[open]
[-] mariadb-admin
[open]
[-] sh
[open]
[-] bash
[open]
[-] mariadb-show
[open]
[-] xmllint
[open]
[-] autoupdate
[open]
[-] perl
[open]
[-] gm
[open]
[-] fc-validate
[open]
[-] vim
[open]
[-] pod2usage
[open]
[-] rview
[open]
[-] c++
[open]
[-] g++
[open]
[-] sed
[open]
[-] identify
[open]
[-] mysqldump
[open]
[-] tty
[open]
[-] ssh-agent
[open]
[-] icuinfo
[open]
[-] mesg
[open]
[-] realpath
[open]
[-] pango-segmentation
[open]
[-] ruby
[open]
[-] git-upload-archive
[open]
[-] sdiff
[open]
[-] bashbug-64
[open]
[-] col
[open]
[-] taskset
[open]
[-] zip
[open]
[-] login
[open]
[-] pwdx
[open]
[-] perlbug
[open]
[-] c99
[open]
[-] mogrify
[open]
[-] python
[open]
[-] grops
[open]
[-] cp
[open]
[-] atq
[open]
[-] kill
[open]
[-] mariadb-embedded
[open]
[-] hostid
[open]
[-] setterm
[open]
[-] gcc-ar
[open]
[-] host
[open]
[-] uptime
[open]
[-] as
[open]
[-] unzipsfx
[open]
[-] link
[open]
[-] rev
[open]
[-] od
[open]
[-] ssh-add
[open]
[-] unzip
[open]
[-] dnstap-read
[open]
[-] zforce
[open]
[-] word-list-compress
[open]
[-] rename
[open]
[-] dir
[open]
[-] split
[open]
[-] nsupdate
[open]
[-] sleep
[open]
[-] tr
[open]
[-] ipcrm
[open]
[-] ps2pdf
[open]
[-] arpaname
[open]
[-] unexpand
[open]
[-] objdump
[open]
[-] tset
[open]
[-] mariadb-secure-installation
[open]
[-] openssl
[open]
[-] mariadb-dump
[open]
[-] chcon
[open]
[-] ps2pdf12
[open]
[-] test
[open]
[-] automake-1.16
[open]
[-] pic
[open]
[-] tail
[open]
[-] mysqlbinlog
[open]
[-] gawk
[open]
[-] pkg-config
[open]
[-] ssh-copy-id
[open]
[-] cldetect
[open]
[-] tput
[open]
[-] tzselect
[open]
[-] column
[open]
[-] c++filt
[open]
[-] c89
[open]
[-] watch
[open]
[-] tmpwatch
[open]
[-] crontab
[open]
[-] ispell
[open]
[-] pathchk
[open]
[-] mcookie
[open]
[-] free
[open]
[-] reset
[open]
[-] fc-cache-64
[open]
[-] enchant-lsmod
[open]
[-] gneqn
[open]
[-] readlink
[open]
[-] gpgsplit
[open]
[-] ssh-keyscan
[open]
[-] zipgrep
[open]
[-] uapi
[open]
[-] ionice
[open]
[-] base64
[open]
[-] gnroff
[open]
[-] nproc
[open]
[-] logname
[open]
[-] icu-config-64
[open]
[-] nl
[open]
[-] lto-dump
[open]
[-] xsltproc
[open]
[-] whereis
[open]
[-] zcmp
[open]
[-] python3.9
[open]
[-] mytop
[open]
[-] localedef
[open]
[-] flock
[open]
[-] grep
[open]
[-] gunzip
[open]
[-] ping
[open]
[-] pl2pm
[open]
[-] geoiplookup
[open]
[-] stty
[open]
[-] dd
[open]
[-] bzmore
[open]
[-] locale
[open]
[-] gpgv
[open]
[-] mv
[open]
[-] ps2pdfwr
[open]
[-] objcopy
[open]
[-] animate
[open]
[-] namei
[open]
[-] utmpdump
[open]
[-] gpg-error
[open]
[-] my_print_defaults
[open]
[-] passenger
[open]
[-] ld
[open]
[-] x86_64-redhat-linux-c++
[open]
[-] nohup
[open]
[-] zless
[open]
[-] less
[open]
[-] mariadb-binlog
[open]
[-] dirname
[open]
[-] ipcs
[open]
[-] ul
[open]
[-] chgrp
[open]
[-] lesskey
[open]
[-] mariadb-tzinfo-to-sql
[open]
[-] zcat
[open]
[-] [
[open]
[-] unlink
[open]
[-] vimtutor
[open]
[-] msql2mysql
[open]
[-] toe
[open]
[-] tabs
[open]
[-] ptx
[open]
[-] autoheader
[open]
[-] selectorctl
[open]
[-] lex
[open]
[-] h2xs
[open]
[-] expr
[open]
[-] run-with-aspell
[open]
[-] freetype-config
[open]
[-] gencat
[open]
[-] gpg
[open]
[-] gcov-dump
[open]
[-] readelf
[open]
[-] ld.bfd
[open]
[-] GET
[open]
[-] scl_enabled
[open]
[-] cagefs_enter.proxied
[open]
[-] sha1sum
[open]
[-] recode
[open]
[-] neqn
[open]
[-] expand
[open]
[-] wc
[open]
[-] libtoolize
[open]
[-] hunspell
[open]
[-] make
[open]
[-] setsid
[open]
[-] icu-config
[open]
[-] ps
[open]
[-] splain
[open]
[-] mariadb-import
[open]
[-] strace
[open]
[-] autom4te
[open]
[-] funzip
[open]
[-] stdbuf
[open]
[-] troff
[open]
[-] ps2ps2
[open]
[-] cut
[open]
[-] pdf2dsc
[open]
[-] sort
[open]
[-] install
[open]
[-] true
[open]
[-] mariadb-setpermission
[open]
[-] join
[open]
[-] printenv
[open]
[-] xargs
[open]
[-] env
[open]
[-] aspell
[open]
[-] vmstat
[open]
[-] rm
[open]
[-] fc-query
[open]
[-] sha384sum
[open]
[-] ps2epsi
[open]
[-] rvi
[open]
[-] base32
[open]
[-] libtool
[open]
[-] gsoelim
[open]
[-] ed
[open]
[-] gtar
[open]
[-] zfgrep
[open]
[-] cc
[open]
[-] zipnote
[open]
[-] false
[open]
[-] Mail
[open]
[-] xmlcatalog
[open]
[-] prove
[open]
[-] tload
[open]
[-] shred
[open]
[-] fc-conflist
[open]
[-] mysqlaccess
[open]
[-] pmap
[open]
[-] rnano
[open]
[-] runcon
[open]
[-] date
[open]
[-] conjure
[open]
[-] cmp
[open]
[-] comm
[open]
[-] vimdiff
[open]
[-] mariadb-slap
[open]
[-] skill
[open]
[-] cpan
[open]
[-] script
[open]
[-] sha224sum
[open]
[-] cksum
[open]
[-] mknod
[open]
[-] chrt
[open]
[-] tee
[open]
[-] id
[open]
[-] getent
[open]
[-] mariadb
[open]
[-] getconf
[open]
[-] automake
[open]
[-] infotocap
[open]
[-] clear
[open]
[-] view
[open]
[-] mysql_config
[open]
[-] perlthanks
[open]
[-] users
[open]
[-] iconv
[open]
[-] pod2man
[open]
[-] colrm
[open]
[-] groups
[open]
[-] zdiff
[open]
[-] at
[open]
[-] fc-list
[open]
[-] renew-dummy-cert
[open]
[-] pydoc3
[open]
[-] pod2text
[open]
[-] python2
[open]
[-] git-upload-pack
[open]
[-] gpg-agent
[open]
[-] ln
[open]
[-] colcrt
[open]
[-] ex
[open]
[-] fgrep
[open]
[-] mysqlcheck
[open]
[-] zgrep
[open]
[-] nice
[open]
[-] gcov-tool
[open]
[-] pdf2ps
[open]
[-] git
[open]
[-] mariadb-hotcopy
[open]
[-] mariadb-dumpslow
[open]
[-] mkdir
[open]
[-] nano
[open]
[-] scl
[open]
[-] python3
[open]
[-] ps2pdf14
[open]
[-] captoinfo
[open]
[-] mail
[open]
[-] ps2ascii
[open]
[-] x86_64-redhat-linux-gcc-11
[open]
[-] atrm
[open]
[-] sha256sum
[open]
[-] perl5.32.1
[open]
[-] getopt
[open]
[-] gcov
[open]
[-] cat
[open]
[-] git-receive-pack
[open]
[-] red
[open]
[-] mktemp
[open]
[-] printf
[open]
[-] pango-list
[open]
[-] tsort
[open]
[-] who
[open]
[-] cloudlinux-awp-user
[open]
[-] egrep
[open]
[-] mariadb-waitpid
[open]
[-] ranlib
[open]
[-] pgrep
[open]
[-] geqn
[open]
[-] mariadb-conv
[open]
[-] eps2eps
[open]
[-] factor
[open]
[-] ghostscript
[open]
[-] perlivp
[open]
[-] preunzip
[open]
[-] tbl
[open]
[-] enc2xs
[open]
[-] uname
[open]
[-] zipcloak
[open]
[-] numfmt
[open]
[-] sha512sum
[open]
[-] x86_64-redhat-linux-g++
[open]
[-] compare
[open]
[-] cpp
[open]
[-] pydoc
[open]
[-] prezip-bin
[open]
[-] uniq
[open]
[-] md5sum
[open]
[-] spell
[open]
[-] mariadb-check
[open]
[-] hostname
[open]
[-] vdir
[open]
[-] addr2line
[open]
[-] import
[open]
[-] convert
[open]
[-] sqlite3
[open]
[-] nslookup
[open]
[-] bzcat
[open]
[-] mariadb-convert-table-format
[open]
[-] df
[open]
[-] seq
[open]
[-] mysql
[open]
[-] gcc
[open]
[-] pydoc3.9
[open]
[-] pinky
[open]
[-] bison
[open]
[-] diff
[open]
[-] gzexe
[open]
[-] mysqladmin
[open]
[-] groff
[open]
[-] geoiplookup6
[open]
[-] display
[open]
[-] bzip2recover
[open]
[-] logger
[open]
[-] mariadb-plugin
[open]
[-] zegrep
[open]
[-] zipsplit
[open]
[-] slabtop
[open]
[-] clwpos-user
[open]
[-] cyrusbdb2current
[open]
[-] ar
[open]
[-] eqn
[open]
[-] autoscan
[open]
[-] screen
[open]
[-] top
[open]
[-] delv
[open]
[-] bzip2
[open]
[-] pod2html
[open]
[-] fc-scan
[open]
[-] lessecho
[open]
[-] idn
[open]
[-] scalar
[open]
[-] which
[open]
[-] prezip
[open]
[-] csplit
[open]
[-] mysql_waitpid
[open]
[-] gcc-ranlib
[open]
[-] make-dummy-cert
[open]
[-] sprof
[open]
[-] wget
[open]
[-] pwd
[open]
[-] php
[open]
[-] pr
[open]
[-] snice
[open]
[-] chown
[open]
[-] gs
[open]
[-] infocmp
[open]
[-] scp
[open]
[-] lesspipe.sh
[open]
[-] ls
[open]
[-] tic
[open]
[-] podchecker
[open]
[-] dbiprof
[open]
[-] perldoc
[open]
[-] look
[open]
[-] instmodsh
[open]
[-] zmore
[open]
[-] pkill
[open]
[-] gpic
[open]
[-] ssh
[open]
[-] flex++
[open]
[-] find
[open]
[-] bzless
[open]
[-] arch
[open]