It only takes a minute to sign up. Connect and share knowledge within a single location that is structured and easy to search. I am trying to write a bash script in a file that would, when run start pinging a host until it becomes available, when the host becomes reachable it runs a command and stops executing, I tried writing one but the script continues pinging until the count ends,. In this approach you are passing the hostname as an argument to the shellscript. Just as a general warning, if your host stays down, you will have this script continuously pinging in the background until you either kill it or the host is found. So I would keep that in mind when you run this.
Batch Script - Logging
Shell Script to Check Ping to Remote Host and Port Open
Press any key What the Where's any key? This posting is provided "AS IS" with no warranties or guarantees and confers no rights.
Subscribe to RSS
Join Stack Overflow to learn, share knowledge, and build your career. Connect and share knowledge within a single location that is structured and easy to search. I'm trying to check response from list of n-thousand IPs using ping command via windows batch script and save all results in a file yes if response and no if don't. Is this even possible via batch script?
Specifically I will show how to scan the final two dotted decimal ranges. So for example, if you want to scan a standard network, you would want to ping the ranges:. These scripts do take a bit of time to run so patience is necessary. If you want to scan more quickly then you can target a specific range, or modify the scripts to just scan the final dotted decimal range.