Bash script ping test

Job ID: 34871193

Budget: $30 – $250 USD

I need a bash script. The goal is:

Ping an IP, if 60% return failed, SSH into a router and run commands to shut the port down.

Do this for 3 IPs. Doesn't matter the outcome of the other. Save data on a log file.