home *** CD-ROM | disk | FTP | other *** search
/ Dream 42 / Amiga_Dream_42.iso / RiscPC / Internet / Connexion / slip.spk / !SLIPdial_Scripts_umnscript < prev    next >
Encoding:
Text File  |  1994-03-31  |  3.6 KB  |  152 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. call mailicon
  9. # main loop
  10. :loop
  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. init ATZQ0V1
  24. retry 2 4
  25. if (!dial/retry=50/delay=5/nodial=60 6261920) return 0
  26. message/capture="This"/centre/max=5
  27. # set username & password for authentication
  28. set username allan@mnhepz.hep.umn.edu
  29. :waitloop
  30. set result {wait /del=50 name: word: server> denied}
  31. case %result
  32.   when 0; goto dialup
  33.   when 1; send %username
  34.   when 2; send %password
  35.   when 3; goto endwaitloop
  36.   when 4; set username alla0008@gold.tc.umn.edu
  37. endcase
  38. if (!?line/dcd) goto dialup
  39. goto waitloop
  40. :endwaitloop
  41. send slip
  42. ipget 134.
  43. return 1
  44.  
  45. # start a session for all activities (smtp, nntp)
  46. :doall
  47. set nntp nntp
  48. set pop pop
  49. set hanguptime "15 2 3"
  50. call/lock dialup
  51. goto common
  52.  
  53. # start a session for mail only
  54. :domail
  55. set nntp #nntp
  56. set pop pop
  57. set hanguptime "15 2 3"
  58. call/lock dialup
  59. goto common
  60.  
  61. # start interactive session
  62. :dointer
  63. set nntp #nntp
  64. set pop #pop
  65. set hanguptime "600 2 2"
  66. call/lock dialup
  67. goto common
  68.  
  69. # start a session for news only
  70. :donews
  71. set nntp nntp
  72. set pop #pop
  73. set hanguptime "15 2 3"
  74. call/lock dialup
  75. :common
  76. make SLIPdial:umnsrc <TCPIP$Dir>.AutoExec
  77. :starttcp
  78. task/exit="if (?line/dcd) goto starttcp"/id="TCPIP" <TCPIP$dir>.!Run
  79. alarm/dcd "goto tcpkill"
  80. :hupwait
  81. wait /event
  82. goto hupwait
  83. :tcpkill
  84. message/close
  85. task /kill="TCPIP"
  86.  
  87. # routine to end call & test for arrived files
  88. :endcall
  89. release
  90. set newmail
  91. if (?file/size <Mail$dir>.spool.mail.text.efp) call movemail efp
  92. if (?file/size <Mail$dir>.spool.mail.text.gta) call movemail gta
  93. if (?file <Mail$dir>.folder.umnNews) move <Mail$dir>.folder.umnNews <NewsSpool$dir>.news*
  94. if (?file <Mail$dir>.folder.demNews) move <Mail$dir>.folder.demNews <NewsSpool$dir>.news*
  95. if (?file <NewsSpool$dir>.mail*) call mailicon;message/cent "New mail for %newmail"
  96. if (?file <NewsSpool$dir>.*) task <Debatch$dir>.!run
  97. # now trim history files if neccessary
  98. call trimfile <TCPIP$Dir>.UmnHist
  99. call trimfile <TCPIP$Dir>.DemHist
  100. return
  101.  
  102. :trimfile
  103. if (?lt {?file/size %p1} 5000) return
  104. echo/status "Trimming %p1"
  105. copy/tail=200 %p1 %p1-T;delete %p1;move %p1-T %p1
  106. return 
  107.  
  108. :movemail
  109. append <Mail$dir>.spool.mail.text.%p1 <Mail$dir>.spool.mail.%p1
  110. append <Mail$dir>.spool.mail.text.%p1 <Mail$dir>.%p1
  111. move <Mail$dir>.spool.mail.text.%p1 <NewsSpool$dir>.mail*
  112. set newmail %newmail%p1
  113. return
  114.  
  115. :mailclick
  116. if (?file <Mail$Dir>.gta) task "filer_run <Mail$Dir>.gta"
  117. if (?file <Mail$Dir>.efp) task "filer_run <Mail$Dir>.efp"
  118. task "remove <Mail$Dir>.gta"
  119. task "remove <Mail$Dir>.efp"
  120.  
  121. :mailicon
  122. set icon nomail
  123. if (?file <Mail$Dir>.gta) set icon mail
  124. if (?file <Mail$Dir>.efp) set icon mail
  125. icon/id=mail/action="call mailclick" %icon
  126. return
  127.  
  128. #
  129. # This loads password config from file or prompts for data to create file.
  130. #
  131. :configure
  132. set filename {?file/expand slipdial:umnconfig}
  133. if (!?file %filename) call setup1
  134. open/read/id=conf/error="return" %filename
  135. read/id=conf/eof="goto closeconf" password
  136. read/id=conf/eof="goto closeconf" gtapass
  137. read/id=conf/eof="goto closeconf" efppass
  138. :closeconf
  139. close/id=conf
  140. return
  141.  
  142. :setup1
  143. input/prompt="Enter authorization password:" password
  144. input/prompt="Enter gta password:" gtapass
  145. input/prompt="Enter efppass:" efppass
  146. open/id=conf/write %filename
  147. write/id=conf %password
  148. write/id=conf %gtapass
  149. write/id=conf %efppass
  150. close/id=conf
  151. return
  152.