home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / internet / net commander 1.0 / ISP / SCRPTLST / WESTNET.CMD < prev    next >
Encoding:
Text File  |  1996-02-27  |  2.0 KB  |  113 lines

  1. #    Login.cmd for WestNet Communications, Inc.
  2. #
  3. #trace on
  4. #
  5. # set up some strings for dialling up
  6. #
  7. if ![load $number]
  8.   if [query $number "Enter WestNet's local phone number"]
  9.     save $number
  10.   end
  11. end
  12. if ![load $username]
  13.   if [username "Enter your login username"]
  14.     save $username
  15.   end
  16. end
  17. if ![load $password]
  18.   if [password "Enter your login password"]
  19.     save $password
  20.   end
  21. end
  22. if ![load $modemsetup]
  23.   if [modemsetup "Enter your modem init string]
  24.     save $modemsetup 
  25.   end
  26. end
  27.  
  28. $prompt = ">"
  29. $userprompt = "ogin:"
  30. $passprompt = "assword:"
  31. $slipcmd = "slip"
  32.  
  33. $addrtarg = "Your address is"
  34. $pppcmd = "ppp"
  35.  
  36. #
  37. #----------------------------------------------------------
  38. #
  39. # initialize modem
  40. #output "ATZ"\13
  41. #if ! [input 10 OK\n]
  42. #  display "Modem is not responding"\n
  43. # abort
  44. # end
  45. #
  46. # setup our modem commands
  47. #
  48. sleep 1
  49. # pause a second for modem to settle after atz
  50. output $modemsetup\13
  51. input 10 OK\n
  52. #
  53. # send phone number
  54. #
  55. %n = 1
  56. repeat
  57. output \13
  58. sleep 2
  59. # send CR and wait 2 seconds for modem to hang up if dialing.
  60. output "atdt"$number\13
  61. %busy = [input 10 BUSY]
  62. sleep 5
  63. # sleep long enough for modem to detect busy and hang up.
  64. if %busy  
  65.   display " attempt "%n" - redialing"\n
  66.   %ok = 0
  67. else
  68.   display \n"Waiting for connection"\n
  69.   %ok = [input 40 CONNECT]
  70. end
  71. %n = %n + 1
  72. until %ok
  73. input 10 \n
  74. #
  75. #  wait till it's safe to send because some modems hang up
  76. #  if you transmit during the connection phase
  77. #
  78. wait 30 dcd
  79. #
  80. # now prod the terminal server
  81. #
  82. output \13
  83. #
  84. #  wait for the username prompt
  85. #
  86. input 30 $userprompt
  87. output ppp:$username\13
  88. #
  89. # and the password
  90. #
  91. input 30 $passprompt
  92. output $password\13
  93. #
  94. # we are now logged in
  95. #
  96. # wait for the address string
  97. #
  98. input 30 to
  99. #
  100. # parse address
  101. #
  102. address 40
  103. #
  104. # we are now connected, logged in and in slip mode.
  105. #
  106.   display \n
  107.   display Connected.  Your IP address is \i.\n
  108. sleep 1
  109. end
  110. #
  111. # now we are finished.
  112. #
  113.