Wait for a set of pings to return successfully, then run a command