home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / internet / starterpck / !SLIPdial / Scripts / call_umn next >
Text File  |  1995-04-11  |  3KB  |  141 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.  "Freenet:call freenet" -
  15.  "Debatch:call endcall" -
  16.  "Setup:call setup1"
  17. wait /event
  18. goto loop
  19. exit
  20.  
  21. # dial up & enter SLIP mode
  22. :dialup
  23. if (!claim 3) goto dialup
  24. message/close
  25. init ATZQ0V1M0
  26. retry 2 4
  27. if (!dial/retry=50/delay=5/nodial=60 6261920) return 0
  28. message/capture="This"/centre/max=5
  29. # set username & password for authentication
  30. set username allan@mnhep1.hep.umn.edu
  31. :waitloop
  32. set result {wait /del=120 name: word: server> denied}
  33. case %result
  34.   when 0; endcase; goto dialup
  35.   when 1; send %username
  36.   when 2; send %password
  37.   when 3; endcase; goto endwaitloop
  38.   when 4; set username alla0008@gold.tc.umn.edu
  39. endcase
  40. if (!?line/dcd) goto dialup
  41. goto waitloop
  42. :endwaitloop
  43. send slip
  44. if (!ipget/del=30/auto) goto dialup
  45. return 1
  46.  
  47. # start a session for all activities (smtp, nntp)
  48. :doall
  49. set nntp nntp
  50. set pop pop
  51. set hanguptime "30 4"
  52. call/lock dialup
  53. goto common
  54.  
  55. # start a session for mail only
  56. :domail
  57. set nntp #nntp
  58. set pop pop
  59. set hanguptime "30 4"
  60. call/lock dialup
  61. goto common
  62.  
  63. # start interactive session
  64. :dointer
  65. set nntp #nntp
  66. set pop #pop
  67. set hanguptime "600 2 2"
  68. call/lock dialup
  69. goto common
  70.  
  71. # start freenet session
  72. :freenet
  73. set nntp #nntp
  74. set pop #pop
  75. set hanguptime "600 2 2"
  76. call/lock dialup
  77. oscli "set inet$address %ipaddress"
  78. oscli "set inet$route %route"
  79. message/close
  80. task <freeuser$dir>.startup
  81. :hup2wait
  82. wait /event
  83. goto hup2wait
  84. goto common
  85.  
  86. # start a session for news only
  87. :donews
  88. set nntp nntp
  89. set pop #pop
  90. set hanguptime "30 4"
  91. call/lock dialup
  92.  
  93. :common
  94. make SLIPdial:umnsrc <TCPIP$Dir>.AutoExec
  95. message/close
  96. :starttcp
  97. task/exit="if (?line/dcd) goto starttcp"/id="TCPIP" <TCPIP2$dir>.!Run
  98. alarm/dcd "goto tcpkill"
  99. :hupwait
  100. wait /event
  101. goto hupwait
  102. :tcpkill
  103. task /kill="TCPIP"
  104.  
  105. # routine to end call & test for arrived files
  106. :endcall
  107. release
  108. if (!?task NewsBase) task <NewsBase$dir>.!run
  109. return
  110.  
  111. :trimfile
  112. if (?lt {?file/size %p1} 10000) return
  113. echo/status "Trimming %p1"
  114. copy/tail=350 %p1 %p1-T;delete %p1;move %p1-T %p1
  115. return 
  116.  
  117. #
  118. # This loads password config from file or prompts for data to create file.
  119. #
  120. :configure
  121. set filename {?file/expand slipdial:umnconfig}
  122. if (!?file %filename) call setup1
  123. open/read/id=conf/error="return" %filename
  124. read/id=conf/eof="goto closeconf" password
  125. read/id=conf/eof="goto closeconf" gtapass
  126. read/id=conf/eof="goto closeconf" efppass
  127. :closeconf
  128. close/id=conf
  129. return
  130.  
  131. :setup1
  132. input/prompt="Enter authorization password:" password
  133. input/hide/prompt="Enter gta password:" gtapass
  134. input/prompt="Enter efppass:" efppass
  135. open/id=conf/write %filename
  136. write/id=conf %password
  137. write/id=conf %gtapass
  138. write/id=conf %efppass
  139. close/id=conf
  140. return
  141.