[Main]
Type = oneshot
Version = 0.1.0
Description = "ACPI support power scripts at boot/shutdown"
User = ( root )
Depends = ( acpid )
Options = ( !log )

[Start]
Build = custom
Execute = (
#!/bin/sh
# Mirror debian/acpi-support.init start.
# Shell bridge required: power-funcs and /etc/acpi/start.d/*.sh are sourced
# (not executed), so they cannot be expressed in pure execline.
test -f /usr/share/acpi-support/power-funcs || exit 0
. /usr/share/acpi-support/power-funcs
test -d /var/lib/acpi-support || exit 0
on_ac_power
if [ $? -eq 1 ]; then
	/etc/acpi/power.sh true
fi
for SCRIPT in /etc/acpi/start.d/*.sh; do
	if [ -f "$SCRIPT" ]; then
		. "$SCRIPT"
	fi
done
exit 0
)

[Stop]
Build = custom
Execute = (
#!/bin/sh
# Mirror debian/acpi-support.init stop.
test -f /usr/share/acpi-support/power-funcs || exit 0
. /usr/share/acpi-support/power-funcs
on_ac_power
if [ $? -eq 1 ]; then
	/etc/acpi/power.sh false
fi
exit 0
)
