403Webshell
Server IP : 104.21.4.30  /  Your IP : 104.23.197.86
Web Server : Apache
System : Linux keen-cori.18-142-40-148.plesk.page 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 06:59:36 UTC 2025 x86_64
User : simottodesign.com_2tntp341vs7 ( 10011)
PHP Version : 8.3.31
Disable Function : opcache_get_status
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/lib/dpkg/info/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/lib/dpkg/info/psa-drweb-configurator.postinst
### Copyright 1999-2023. Plesk International GmbH. All rights reserved.
#-*- vim:ft=sh:

set_drweb_params()
{
	drweb_user="drweb"
	drweb_group="drweb"

	DRWEB_ETC_D="/etc/drweb"
	DRWEB_ROOT_D="/opt/drweb"

	PRODUCT_ROOT_D="/opt/psa"
}

update_drweb_service_state()
{
	local drwebmng="$PRODUCT_ROOT_D/admin/sbin/drwebmng"
	"$drwebmng" --update
}

mail_drweb_restore()
{
	local mail_restore="/usr/lib/plesk-9.0/mail_drweb_restore"
	if [ -x "$mail_restore" ]; then
		"$mail_restore" "$@"
	else
		return 1
	fi
}

add_string()
{
	local pattern string config
	pattern="$1"
	string="$2"
	config="$3"

	if ! grep -q "^$pattern\$" "$config"; then
		echo "$string" >>"$config"
	fi
}

config_drweb_key_expiration_notifications()
{
	# Turn key expiration notifications for 2 days in drweb config files
	# Add New parameters for DrWeb upgrade

	add_string '[[:space:]]*NotifyPeriod[[:space:]]*=.*' \
		"NotifyPeriod = 2" "$DRWEB_ETC_D/drweb32.ini"

	add_string '[[:space:]]*NotifyType[[:space:]]*=.*' \
		"NotifyType = Everyday" "$DRWEB_ETC_D/drweb32.ini"

	# Change Default values for clear Drweb installation
	NotifyPeriod=2
	NotifyType=Everyday

	sed -e 's/^[[:space:]]*NotifyPeriod[[:space:]]*=[[:space:]]*14/NotifyPeriod = '$NotifyPeriod'/g' \
		-e 's/^[[:space:]]*NotifyType[[:space:]]*=[[:space:]]*Ever[[:space:]]*$/NotifyType = '$NotifyType'/g' \
	< $DRWEB_ETC_D/drweb32.ini > $DRWEB_ETC_D/drweb32.ini.tmp && \
	mv -f $DRWEB_ETC_D/drweb32.ini.tmp $DRWEB_ETC_D/drweb32.ini || return 1

	chown "$drweb_user:$drweb_group" "$DRWEB_ETC_D/drweb32.ini" || return 1
	chmod 0644 "$DRWEB_ETC_D/drweb32.ini" || return 1
}
### Copyright 1999-2023. Plesk International GmbH. All rights reserved.
#-*- vim:ft=sh:

drweb_add_drweb_to_outgoing_antispam_whitelist()
{
	local mailmng_outgoing="${PRODUCT_ROOT_D}/admin/sbin/mailmng-outgoing"
	if [ -x "$mailmng_outgoing" ]; then
		"$mailmng_outgoing" --show-whitelist | grep -q "$drweb_user" >/dev/null 2>&1 \
			|| "$mailmng_outgoing" --add-to-whitelist --sysuser="$drweb_user"
	fi
}

drweb_fix_logs_permissions()
{
    # Fixing permissions to avoid logrotate errors from bug #141554, PPP-45087
    local drweb_logs_package_location="/var/drweb/log"
    [ ! -d "$drweb_logs_package_location" ] || chmod 0750 "$drweb_logs_package_location"
}

qmail_admin_alias()
{
	local dot_qmail="$DRWEB_ROOT_D/.qmail"
	[ ! -s "$dot_qmail" ] || return 0
	echo "&root" > "$dot_qmail"
	chmod 0600 "$dot_qmail"
	chown "$drweb_user:$drweb_group" "$dot_qmail"
}

# Update Dr.Web to prevent it from bothering the administrator with notifications
# about old bases
drweb_update()
{
	local update_bin="/etc/cron.daily/drweb-update"

	# Run it after (some) min(s) in order to avoid packages' install-time CPU/memory load
	# In the contrary, we need to run updater as soon as possible in order to keep antivirus healthy; be wise.
	[ -x "$update_bin" ] && systemd-run --on-active="1m" "$update_bin"
	return 0
}

upgrade_new_post()
{
	drweb_fix_logs_permissions
	drweb_update
}

install_post()
{
	set_drweb_params

	qmail_admin_alias
	drweb_add_drweb_to_outgoing_antispam_whitelist

	drweb_fix_logs_permissions

	config_drweb_key_expiration_notifications

	# Stop service started via sysvinit script (by the drweb-daemon package)
	/etc/init.d/drwebd stop	|| killall $DRWEB_ROOT_D/drwebd.real || :
	# register drweb handler for existing mailnames
	# this also turns on or off the service if required
	# alternative via drwebmng is a safety fallback
	mail_drweb_restore || update_drweb_service_state

	drweb_update
}

[ -z "$PLESK_INSTALLER_DEBUG" ] || set -x
[ -z "$PLESK_INSTALLER_STRICT_MODE" ] || set -e

case "$1" in
	configure)
		if [ -n "$2" ]; then
			upgrade_new_post
		else
			install_post
		fi
		;;
	abort-upgrade|abort-remove|abort-deconfigure)
		;;
	*)
		echo "Unknown operation: postinst $*"
		exit 1
		;;
esac

Youez - 2016 - github.com/yon3zu
LinuXploit