home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / internet / slipdial_1 / !Slipdial / Scripts / celtic next >
Text File  |  1996-02-02  |  3KB  |  152 lines

  1. #slipdial Celtic internet services ltd
  2. # written by tor houghton (torh@celtic.co.uk), august 1995
  3. # version 0.00
  4. #
  5. # make sure you change YOURHOST and YOURPASSWORD in the
  6. # 'configure' subroutine
  7. #
  8.  
  9. # --------------------------------------------------------------
  10.  
  11. call initialise
  12. call configure
  13. call setserial
  14. call makemenu
  15.  
  16. # --------------------------------------------------------------
  17.  
  18. # main loop (idling, waiting for someone to click a menu)
  19. :mainloop
  20. message /close
  21. wait /event
  22. goto mainloop
  23. exit
  24.  
  25. # --------------------------------------------------------------
  26.  
  27. # dialing routine (i know this is going to be a serious
  28. # pain in the backside)
  29. :dialit
  30.  
  31. # claim device driver
  32. if (!claim 3) return 0
  33.  
  34. # initialise modem
  35. init
  36.  
  37. # dial the number, return to menu if failed
  38. retry %nretries 15
  39. if (!dial /nodial=15 /nocar=25 /busy=1 %phonenumber) return 0
  40.  
  41. # if the dial succeeded, we should be here in the script
  42. # (oh, we are hopeful today)
  43. if (!wait /del=25 ogin:) goto failed_login
  44. send %nodename
  45.  
  46. if (!wait /del=25 word:) goto failed_passwd
  47. send %password
  48.  
  49. if (!wait /del=25 enabled) goto failed_enabled
  50.  
  51. # ok, assuming this is correct, we should now fire up the
  52. # freenet tcp/ip stack here
  53.  
  54. oscli <FreeUser$Dir>.Startup
  55.  
  56. # look for data carrier detect to go low (e.g. hangup)
  57. alarm /dcd "goto exit_hangup"
  58. :dialit_loop
  59. wait /event
  60. goto dialit_loop
  61.  
  62. # --------------------------------------------------------------
  63.  
  64. # failed at the login detect
  65. :failed_login
  66. message "Failed to detect login prompt, exiting..." /centre
  67. release
  68. reinit
  69. return 0
  70.  
  71. # --------------------------------------------------------------
  72.  
  73. # failed after entering login
  74. :failed_login
  75. message "Failed to detect password prompt, exiting..." /centre
  76. release
  77. reinit
  78. return 0
  79.  
  80. # --------------------------------------------------------------
  81.  
  82. # failed detecting "packet mode enabled"
  83. :failed_login
  84. message "Failed to detect 'packet mode', exiting..." /centre
  85. release
  86. reinit
  87. return 0
  88.  
  89. # --------------------------------------------------------------
  90.  
  91. # hey! we're optimistic today!
  92. :exit_hangup
  93. oscli <FreeUser$Dir>.Shutdown
  94. message /close
  95. message "Call completed." /centre
  96. release
  97. pause 2
  98. return 1
  99.  
  100. # now, in the original script, this is where you start your
  101. # mail and news clients. maybe i'll do that later.
  102.  
  103. # insert your commands to start news/mail here
  104.  
  105. # --------------------------------------------------------------
  106.  
  107. # cardiff point of presence (pop)
  108. :CF
  109. set nretries 25
  110. set phonenumber 01222340420
  111. goto dialit
  112. return
  113.  
  114.  
  115. # --------------------------------------------------------------
  116.  
  117. # set up the menu in slipdial
  118. :makemenu
  119. menu "Cardiff:call CF"
  120. return 1
  121.  
  122. # --------------------------------------------------------------
  123.  
  124. # configure serial settings
  125. :setserial
  126. driver USR
  127. port %wport %prtnum
  128. speed %speed
  129. # not sure if we need this
  130. set protocol slip
  131. return 1
  132.  
  133. # --------------------------------------------------------------
  134.  
  135. # configuration subroutine
  136. :configure
  137. set wport Internal
  138. set portnum 0
  139. set speed 0
  140. set nodename YOURHOST.celtic.co.uk
  141. set password YOURPASSWORD
  142. return 1
  143.  
  144. # --------------------------------------------------------------
  145.  
  146. # subroutine general initialisation - not much is here at the moment
  147. :initialise
  148. debug 3
  149. return 1
  150.  
  151.  
  152.