Simplified the way to check whether the script is running on EC2