Add script for clean shutdown