Added exception handling and sample bash script