Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = { ... }
- if #tArgs == 0 then
- print( "Usage: ping <ip> [<gateip>]" )
- return
- end
- if not open() then return end
- if not getIP(tArgs[2]) then return end
- print('Pinging '..tArgs[1])
- for i=1,4 do
- start=os.clock()
- send(tArgs[1],'ping')
- mess,sIP=receive(3)
- if mess then
- if mess=='pong' then
- print('Answer from ',sIP,' time=',os.clock()-start)
- else
- print(sIP,': ',mess)
- end
- else
- print('Time out')
- end
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement