- GRAYBYTE UNDETECTABLE CODES -

403Webshell
Server IP : 184.154.167.98  /  Your IP : 18.118.205.123
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 : 7.2.34
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /sbin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /sbin/clnreg_ks
#!/bin/bash

# author: Vasiliy Kleschov <vkleschov@cloudlinux.com>
# created: 2018-03-14
# CloudLinux IP registration tool

SKIP_RHNCHECK=0
SHOW_HELP=0
SYSTEMID_FILE="/etc/sysconfig/rhn/systemid"
LOG_FILE="/var/log/up2date"

# simple cycle that does not meant to do
# some completed stuff like positional arguments
# if you need something more -> rewrite this script in python
for opt in "$@"
do
    case "$opt" in
        --force) SKIP_RHNCHECK=1
            ;;
        --help|-h) SHOW_HELP=1
            ;;
        --activationkey=*|--activationkey)
            ;;
        --edition=*|--edition)
            ;;
    esac
done

# we should show help even if license exists
if [[ ${SHOW_HELP} == 1 ]]; then
    /usr/sbin/rhnreg_ks --help
    exit $?
fi;

# the meaning of the following checks is:
# 1. to run ip registration on first yum-rhn-plugin
#    activation (probably right after vm boot)
# 2. to fix ip license if some template contains
#    systemid file for no reason (that is error 9 from CLN)
# but don't change license if cln is just down

# if systemid does not exist it means we don't have
# license yet and not reason to call rhn_check (it will fail anyway)
if [[ -f "${SYSTEMID_FILE}" ]]; then
  # skip rhn_check only with --force option passed
  if [[ ${SKIP_RHNCHECK} == 0 ]]; then
      result=$(rhn_check 2>&1)
      rc=$?
      if [[ "${rc}" = "0" ]]; then
          echo "Command rhn_check exited with code zero." \
               "That usually means that registration is not needed." \
               "Use --force to override"
          exit 0
      elif [[ "${result}" =~ "Invalid System Credentials" ]]; then
          # we get and error meaning that systemid of server is
          # no longer valid for server-side application
          # in this case we can try obtaining new license
          echo "${result}" >> "${LOG_FILE}"
          echo "Seems like server is missing license. Trying to get new one using IP licensing flow." | tee -a "${LOG_FILE}"
      else
          echo "${result}" | tee -a "${LOG_FILE}"
          echo "Unable to check license status and register server." \
               "Use --force to override"
          exit $rc
      fi;
  fi;
else
  echo "Server does not have active license yet. Trying to get one using IP licensing flow."
fi

/usr/sbin/rhnreg_ks --activationkey=IPL --force $@
ret=$?

if grep -q "ID=ubuntu" "/etc/os-release"; then
    # pre_invoke is used to update apt repositories
    /usr/lib/apt-spacewalk/pre_invoke.py
fi

exit $ret

Youez - 2016 - github.com/yon3zu
LinuXploit