Exiting the startup script on error
Added a shutdown script