bash file for autorestart and email notification