Added a script to run before shutting down.