reworked the icmp shell script to python