Is it possible to run a specific script and receive a message (like msg command) when the pinged machine becomes available?
ping -n <Address> | find "TTL=" && (
msg * Online
)
Here is a PowerShell way:
ping -t <Address> | Select-String 'TTL=' | Select-Object -First 1
msg * Online
ping -t <Address>
repeatedly pings the given host.Select-String 'TTL='
searches each output line of ping
for the given RegEx pattern. If found, it is piped to the next command.Select-Object -First 1
ends the pipeline as soon as the first line has been found.| Out-Null
.