home *** CD-ROM | disk | FTP | other *** search
/ Dream 42 / Amiga_Dream_42.iso / RiscPC / Internet / Connexion / SPak.spk / !SLIPdial_Scripts_default < prev    next >
Encoding:
Text File  |  1994-09-10  |  2.6 KB  |  124 lines

  1. #slipdial
  2. debug 1
  3. call configure
  4. icon/file=<slipdial$resources>.mailboxes
  5. alarm /repeat /time=04:30 /id=everyday "call doall"
  6. alarm /stop="goto loop"
  7. port sp_dual 0;speed 57600;retry 3 30
  8. # main loop
  9. :loop
  10. unset ipaddress
  11. menu "Start All:call doall" "Start Mail:call domail" -
  12.  "Start News:call donews" -
  13.  "Interactive:call dointer" -
  14.  "Debatch:call endcall" -
  15.  "Setup:call setup1"
  16. wait /event
  17. goto loop
  18. exit
  19.  
  20. # dial up & enter SLIP mode
  21. :dialup
  22. if (!claim 3) goto dialup
  23. message/close
  24. init ATZQ0V1M0
  25. retry 2 4
  26. if (!dial/retry=50/delay=5/nodial=60 0274755066) return 0
  27. message/capture="This"/centre/max=5
  28. # set username & password for authentication
  29. set username alan@midwife.demon.co.uk
  30. :waitloop
  31. set result {wait /del=50 name: word: server> denied}
  32. case %result
  33.   when 0; endcase; goto dialup
  34.   when 1; send %username
  35.   when 2; send %password
  36.   when 3; endcase; goto endwaitloop
  37.   when 4; set username alla0008@gold.tc.umn.edu
  38. endcase
  39. if (!?line/dcd) goto dialup
  40. goto waitloop
  41. :endwaitloop
  42. send slip
  43. if (!ipget/del=30/auto) goto dialup
  44. return 1
  45.  
  46. # start a session for all activities (smtp, nntp)
  47. :doall
  48. set nntp nntp
  49. set pop pop
  50. set hanguptime "15 2 3"
  51. call/lock dialup
  52. goto common
  53.  
  54. # start a session for mail only
  55. :domail
  56. set nntp #nntp
  57. set pop pop
  58. set hanguptime "15 2 3"
  59. call/lock dialup
  60. goto common
  61.  
  62. # start interactive session
  63. :dointer
  64. set nntp #nntp
  65. set pop #pop
  66. set hanguptime "600 2 2"
  67. call/lock dialup
  68. goto common
  69.  
  70. # start a session for news only
  71. :donews
  72. set nntp nntp
  73. set pop #pop
  74. set hanguptime "15 2 3"
  75. call/lock dialup
  76. :common
  77. make SLIPdial:umnsrc <TCPIP$Dir>.AutoExec
  78. message/close
  79. :starttcp
  80. task/exit="if (?line/dcd) goto starttcp"/id="TCPIP" <TCPIP2$dir>.!Run
  81. alarm/dcd "goto tcpkill"
  82. :hupwait
  83. wait /event
  84. goto hupwait
  85. :tcpkill
  86. task /kill="TCPIP"
  87.  
  88. # routine to end call & test for arrived files
  89. :endcall
  90. release
  91. if (!?task NewsBase) task <NewsBase$dir>.!run
  92. return
  93.  
  94. :trimfile
  95. if (?lt {?file/size %p1} 10000) return
  96. echo/status "Trimming %p1"
  97. copy/tail=350 %p1 %p1-T;delete %p1;move %p1-T %p1
  98. return 
  99.  
  100. #
  101. # This loads password config from file or prompts for data to create file.
  102. #
  103. :configure
  104. set filename {?file/expand slipdial:umnconfig}
  105. if (!?file %filename) call setup1
  106. open/read/id=conf/error="return" %filename
  107. read/id=conf/eof="goto closeconf" password
  108. read/id=conf/eof="goto closeconf" gtapass
  109. read/id=conf/eof="goto closeconf" efppass
  110. :closeconf
  111. close/id=conf
  112. return
  113.  
  114. :setup1
  115. input/prompt="Enter authorization password:" password
  116. input/prompt="Enter gta password:" gtapass
  117. input/prompt="Enter efppass:" efppass
  118. open/id=conf/write %filename
  119. write/id=conf %password
  120. write/id=conf %gtapass
  121. write/id=conf %efppass
  122. close/id=conf
  123. return
  124.