3000
     �ÂÁÀ      File not found.
     �Âa–Ðz¾””ÔD¨ 	Å+�nã!S�ÿÁ      File not found.
  "   	ˆl–Ðz¾””ÔD¨ 	Å+�Á>¦-ÿÀƒh¹¿Â      	MAJOR=5
MINOR=2
DEVNAME=ptmx
DEVMODE=0666
     �Ä¿Â      File not found.
  1   ˆl—äY>”Je¶¥8 [¸ËWmLZ7ÿÁƒu±;_ŒuÐb&=LyYÿÁÄ g    #!/usr/bin/bash

DOCTOR_VERSION='1.0-8'

LC_ALL=en_US.UTF-8
LANG=en_US.UTF-8
LANGUAGE=en_US.UTF-8
DEST=/root/cl-report

DOCTOR_HOST=${1:-https://patches.kernelcare.com}
UPLOAD_URL="${DOCTOR_HOST}/doctor/upload"
SHOWIP_URL="${DOCTOR_HOST}/myip"
CAT=$(command -v cat)
UNAME=$(command -v uname)
CP="Unknown"
SERVER_ID=
main_ip='NA'

cleanup() {
  rm -f $DEST $DEST.wget
}

test_curl() {
  command -v curl >/dev/null 2>&1
  return $?
}

test_wget() {
  command -v wget >/dev/null 2>&1
  # shellcheck disable=SC2181  # Acknowledge check exit code indirectly with $?
  if [ 0 -eq $? ]; then
    if [ -x "$(command -v wget)" ]; then
      return 0
    fi
  fi
  return 1
}

curl_upload() {
  curl --fail -s -H "serverid: $SERVER_ID" -F reportfile=@"$DEST" "$UPLOAD_URL"
  return $?
}

wget_upload() {
  echo -e "--FILEUPLOAD\r\n" > $DEST.wget
  echo -e "--FILEUPLOAD\r\n" > $DEST.wget
  # shellcheck disable=SC2129  # This is mainly a stylistic issue, and can freely be ignored.
  echo -e "Content-Disposition: form-data; name=\"reportfile\"; filename=\"$DEST\"\r\n" >> $DEST.wget
  echo -e "Content-Type: application/octet-stream\r\n" >> $DEST.wget
  echo -e "Media Type: application/octet-stream\r\n\r\n" >> $DEST.wget
  cat $DEST >> $DEST.wget
  echo -e "--FILEUPLOAD--\r\n" >> $DEST.wget
  wget -O - -qq -t 1 --header="serverid: $SERVER_ID" --header="Content-type: multipart/form-data; boundary=FILEUPLOAD" --post-file $DEST.wget "$UPLOAD_URL"
  return $?
}

get_server_id() {
  if [ -f /etc/sysconfig/kcare/systemid ]; then
    # shellcheck source=/dev/null
    source /etc/sysconfig/kcare/systemid
    # shellcheck disable=SC2154
    SERVER_ID="$server_id"
  else
    SERVER_ID="${main_ip//./_}"
  fi
}

init_main_ip() {
   if test_curl
   then
      main_ip=$(curl -4 -s -L "${SHOWIP_URL}") 2>/dev/null
   else
      main_ip=$(wget -qq --inet4-only -O - "${SHOWIP_URL}") 2>/dev/null
   fi
}

get_main_ip() {
  sep "Main IP"
  echo "$main_ip" >> $DEST
  echo >>$DEST
}

upload() {
  if test_curl
  then
    curl_upload
  else
    wget_upload
  fi
  return $?
}

mecho(){
  echo "$1" >> $DEST
}

start(){
  if ! test_wget; then
    if ! test_curl; then
      echo "Cannot find wget or curl"
    fi
    #echo "Using curl"
  fi
  echo "------ CL INFO ---" > $DEST
}

sep(){
  echo "------ $1 ---" >> $DEST
}

run(){
  sep "$1"
  sh -c "$1" >> $DEST 2>&1
}

dump() {
  sep "cat $1"
  $CAT "$1"  >> $DEST 2>&1
}

detect_cp() {
  CP_VERSION="Unknown"
  SOFTACULOUS=0
  if [ -d "/usr/local/psa/admin/" ]; then
    CP="Plesk"
    CP_VERSION=$(cat /usr/local/psa/version)
    if [ -e "/usr/local/softaculous" ]; then SOFTACULOUS=1; fi
  fi
  if [ -d "/usr/local/cpanel/whostmgr/docroot/" ]; then
    CP="cPanel"
    CP_VERSION=$(/usr/local/cpanel/cpanel -V)
    if [ -e "/usr/local/cpanel/whostmgr/cgi/softaculous" ]; then SOFTACULOUS=1; fi
  fi
  if [ -d "/usr/local/interworx/" ]; then
    CP="InterWorx"
    CP_VERSION=$(cat /usr/local/interworx/iworx.ini|grep version)
    if [ -e "/usr/local/softaculous" ]; then SOFTACULOUS=1; fi
  fi
  if [ -d "/usr/local/ispmgr/" ]; then
    CP="ISPmanager"
    CP_VERSION=$(/usr/local/ispmgr/bin/ispmgr -v)
    if [ -e "/usr/local/softaculous" ]; then SOFTACULOUS=1; fi
  fi
  if [ -d "/usr/local/directadmin/plugins/" ]; then
    CP="DirectAdmin"
    CP_VERSION=$(/usr/local/directadmin/custombuild/build versions|sed -n 2p|cut -d":" -f2)
    if [ -e "/usr/local/directadmin/plugins/softaculous" ]; then SOFTACULOUS=1; fi
  fi
  if [ -d "/usr/local/hostingcontroller/" ]; then
    CP="Hosting Controller"
    if [ -e "/usr/local/softaculous" ]; then SOFTACULOUS=1; fi
  fi
  if [ -d "/hsphere/shared" ]; then
    CP="H-Sphere"
  fi
  sep "Control Panel"
  mecho "CP: $CP"
  mecho "VERSION: $CP_VERSION"
  mecho "SOFTACULOUS: $SOFTACULOUS"
}

get_packages() {
