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: //usr/share/init/syno_poweroff_task.conf
description	"Synology custom poweroff task"

start on runlevel [06]
stop on runlevel [!06]

task

console output

env PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin

script
if [ "$RUNLEVEL" = 0 ]; then
	if [ "$INIT_HALT" != "HALT" ]; then
		# poweroff
		echo "System is going to poweroff."
		/usr/bin/logger -p err -t syno_poweroff_task "System is acting poweroff."
		/usr/syno/bin/syno_poweroff_task -p > /dev/null 2>&1
	fi
else
	# reboot
	echo "System is going to reboot."
	/usr/bin/logger -p err -t syno_poweroff_task "System is acting reboot."
	/usr/syno/bin/syno_poweroff_task -r > /dev/null 2>&1
fi
end script
# vim:ft=upstart