Now the shutdown job will be started on shutdown and reboot events. The
UPSTSRT_EVENTS variable is used to determite the request and perform the action.
-description "Shutdown the system"
+description "Shutdown or reboot the system"
author "IPFire Team"
+start on shutdown
+start on reboot
+
console output
-task
-exec initctl emit --no-wait shutdown
+script
+ # Some stuff for the shutdown / reboot process
-post-stop script
- poweroff -f
+ # The UPSTART_EVENTS variable contains the event that has called the
+ # script and is used to perform the requested action.
+ if [ "$UPSTART_EVENTS" -eq shutdown ]; then
+ poweroff -f
+ else
+ reboot -f
+ fi
end script