File: //etc/init/poweroff.conf
description "Synology poweroff"
start on runlevel 0 and stopped umount-root-fs and umount-root-ok
stop on runlevel [!0]
task
console none
script
## make sure runlevel is not 6 (reboot)
run_level=`runlevel | awk '{ printf $2 }'` || true
if [ "x${run_level}" = "x6" ]; then
echo "incorrect runlevel, skip poweroff"
exit 0
fi
if [ "$INIT_HALT" = "" ]; then
INIT_HALT=POWEROFF
fi
# If INIT_HALT=HALT don't poweroff.
poweroff="-p"
if [ "$INIT_HALT" = "HALT" ]; then
poweroff=""
fi
if /bin/get_key_value /etc.defaults/synoinfo.conf unique | /bin/grep broadwellntb; then
/sbin/ifconfig ntb_eth0 down || true
fi
halt -f $poweroff
end script
# vim:ft=upstart