!7 static S ip = "tinybrain.de" /*"127.0.0.1"*/; static int count = 2; static boolean result; p { // Java has trouble executing pings, so we use the native command. S cmd = "ping " + (isWindows() ? "-n" : "-c") + " " + count + " " + ip; S output = backtick(cmd); print(output); L tok = javaTok(output); int i = findCodeTokens(tok, "ttl", "="); if (i < 0) i = findCodeTokens(tok, "TTL", "="); result = i >= 0; print(result ? ip + " is reachable." : ip + " is not reachable."); }