Added proper TERM signal handler
SHOULD be the right script to start out with