home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / internet / net commander 1.0 / ISP / SCRPTLST / NETAXIS.CMD < prev    next >
Encoding:
Text File  |  1996-03-01  |  2.2 KB  |  129 lines

  1. #    Login.cmd for NetAxis Inc. of Montreal
  2. #
  3. #trace on
  4. #
  5. # set up some strings for dialling up
  6. #
  7. if ![load $number]
  8.   if [query $number "Enter your dial up 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.  
  23. if ![load $modemsetup ]
  24.   if [query $modemsetup "Enter Modem setup-string or 'default' or 'usr'"]
  25.     if ( $modemsetup = "default" )
  26.         $modemsetup = "&f&c1&d2&w"
  27.         end
  28.     if ( $modemsetup = "usr" )
  29.         $modemsetup = "&fe1v1&c1x4&a3&b1&i0&r1&h1&m4&n0s0=0&w"
  30.         end
  31.     save $modemsetup
  32.     end
  33.   end
  34.  
  35. $prompt = ">"
  36. $userprompt = "ogin:"
  37. $passprompt = "assword:"
  38. $slipcmd = "slip"
  39. $addrtarg = "Your address is"
  40. $pppcmd = "ppp"
  41.  
  42. %attempts = 10
  43. #
  44. #
  45. #----------------------------------------------------------
  46. #
  47. # initialize modem
  48. #
  49. output "atz"\13
  50. if ! [input 10 OK\n]
  51.   display "Modem is not responding"\n
  52.   abort
  53. end
  54. #
  55. # setup our modem commands
  56. #
  57. output "at"$modemsetup\13
  58. input 10 OK\n
  59. #
  60. # send phone number
  61. #
  62. %n = 0
  63. repeat
  64.   if %n = %attempts
  65.     display "Too many dial attempts"\n
  66.     abort
  67.   end
  68.   output "atdp"$number\13
  69.   %ok = [input 50 CONNECT]
  70.   %n = %n + 1
  71. until %ok
  72. input 10 \n
  73. #
  74. #  wait till it's safe to send because some modem's hang up
  75. #  if you transmit during the connection phase
  76. #
  77. wait 30 dcd
  78. #
  79. # now prod the terminal server
  80. #
  81. output \13
  82. #
  83. #  wait for the username prompt
  84. #
  85. input 30 $userprompt
  86. output $username\13
  87. #
  88. # and the password
  89. #
  90. input 30 $passprompt
  91. output $password\13
  92. #
  93. # we are now logged in
  94. #
  95. input 30 $prompt
  96. if %ppp
  97.   #
  98.   # jump into ppp mode
  99.   #
  100.   output $pppcmd\13
  101.   #
  102.   input 30 \n
  103.   #
  104.   display "PPP mode selected.  Will try to negotiate IP address."\n
  105.   #
  106. else
  107.   #
  108.   # jump into slip mode
  109.   #
  110.   output $slipcmd\13
  111.   #
  112.   # wait for the address string
  113.   #
  114.   input 30 $addrtarg
  115.   #
  116.   # parse address
  117.   #
  118.   address 30
  119.   input 30 \n
  120.   #
  121.   # we are now connected, logged in and in slip mode.
  122.   #
  123.   display \n
  124.   display Connected.  Your IP address is \i.\n
  125. end
  126. #
  127. # now we are finished.
  128. #
  129.