home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / k95 / recover.ksc < prev    next >
Text File  |  2020-01-01  |  2KB  |  52 lines

  1. ; Kermit 95 script demonstrating how to use file transfer recovery
  2. ; to really, *really*, REALLY transfer a file.
  3. ; This example uses a UNIX host and a Practical Peripherals modem.
  4. ;
  5. ; C. Gianone, F. da Cruz, Jan 1995.
  6.  
  7. if not def LOGIN take \v(startup)login.ksc
  8.  
  9. define \%s 20          ; Seconds to pause between each try
  10. define \%n 7654321      ; Phone number (replace appropriately)
  11. define \%f fy9495.wks      ; Name of the file to send
  12.  
  13. set port com1          ; Communication port (ditto)
  14. set modem type pp14400      ; Modem type (ditto)
  15.  
  16. ask \%u { username: }         ; Your username on the other computer
  17. askq \%p { \%u's password: }  ; Your password on the other computer
  18.  
  19. set file type binary      ; File transfer mode must be binary
  20. set count 50          ; Try up to 50 times to send the file
  21. goto nomsg          ; Skip message the first time
  22.  
  23. :LOOP              ; Come here to redial
  24. hangup              ; Give the phone line a rest
  25. echo CONNECTION BROKEN.
  26. echo Pausing for \%s seconds...
  27. sleep \%s
  28. Echo redialing...
  29.  
  30. :NOMSG
  31. dial \%n          ; Dial the phone number
  32. if fail goto AGAIN      ; Keep trying...
  33. login \%u \%p
  34. if fail goto AGAIN
  35.  
  36. out kermit -r\13      ; kermit -r(eceive) on remote system
  37. input 10 KERMIT READY      ; Wait for READY message
  38. pause 1              ; Plus a second for safety
  39. resend fy9495.wks      ; RESEND the file
  40. if success goto done      ; Success means file is completely transferred
  41.  
  42. :AGAIN
  43. if count goto LOOP      ; Otherwise, try again.
  44. Stop 1 Too many tries.      ; Too many tries, give up.
  45.  
  46. :DONE
  47. echo File transferred OK  ; Success, give message
  48. output exit\13          ; Log out from remote computer
  49. pause 5              ; Give it time...
  50. hangup              ; Hang up
  51. stop 0 Script succeeded      ; Finished, the end.
  52.