PING broken check

Hello,

I found this post interesting cause I want to check some ip addresses throught ping, traceroute or telnet+port

1.I dont need

but an if condition so that I can

  1. Each test (ping,trace or telnet) is towards different ip address so I just have to cancel

and each time specify the host something like this?

Kind regards