dst = arg[1] flag, outputs = rt.command("ping -c 1 " .. dst) if flag then first_line = string.match(outputs, "^(.-)\n") print(first_line) else print("ERROR: ping -c 1 " .. dst) end