Posted By

fortyfoxes on 10/06/06


Tagged

TranScript process


Versions (?)

Ping


 / Published in: Other
 

  1. local ckpingID = ""
  2. local procName
  3.  
  4. on startPing ipaddr
  5. if ckpingID is empty then
  6. put "/sbin/ping"&&ipaddr into procName
  7. open process procName for text read
  8. put empty into field "field"
  9. ckPing
  10. end if
  11. end startPing
  12.  
  13. on ckPing
  14. read from process procName until empty
  15. put the result into r
  16. if r is empty or r is "eof" then
  17. put it after field "field"
  18. else
  19. put " [" & r & "] " after field "field"
  20. end if
  21. send "ckPing" to me in .3 seconds
  22. put the result into ckpingID
  23. end ckPing
  24.  
  25. on stopPing
  26. close process procName
  27. wait .1 seconds
  28. if procName is among the lines of openProcesses() then kill
  29. process procName
  30. cancel ckpingID
  31. put empty into ckpingID
  32. end stopPing

Report this snippet  

You need to login to post a comment.