stop script from running further while rebooting