exiting script causes problem for service scripts.
fix to make script runnable as a standalone shell script.