Added option to execute commands on shutdown.