HEX
Server: Apache/2.2.34 (Unix) mod_fastcgi/mod_fastcgi-SNAP-0910052141
System: Linux Kou-Etsu-Dou 4.4.59+ #25556 SMP PREEMPT Thu Mar 4 18:03:46 CST 2021 x86_64
User: hosam (1026)
PHP: 7.2.29
Disabled: NONE
Upload Files
File: //volume1/@appstore/MailPlus-Server/hook/MailPlusServer-SynoAV-McAfeeStop.sh
#!/bin/bash

###############################################################
#	This script should be hooked when SynoAV-McAfee is stopped
###############################################################

NOT_SHUTTING_DOWN="System is not shutting down"

LOG_ERR=3

err_log() {
	logger -u '/var/run/syslog' -t 'MailPlus-Server' -p ${LOG_ERR} "<$0>: " "$@"
}

boot_status="$(synobootseq --is-shutdown)"

if [[ "${NOT_SHUTTING_DOWN}" == "${boot_status}" ]] && { [[ "STOP" == "${SYNOPKG_PKG_STATUS}" ]] || [[ "UNINSTALL" == "${SYNOPKG_PKG_STATUS}" ]]; }; then
	err_log "AntiVirus-McAfee is going to stop, fallback to clamav"
	/var/packages/MailPlus-Server/target/scripts/daemon/synoav_mcafee.sh fallback_to_clamav
fi