home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 2002 July / APC0702D1.iso / isp / tpgi / HelpDesk / scripts / Trumpet / Tpgiold.cmd < prev   
Encoding:
Text File  |  2000-09-24  |  2.0 KB  |  119 lines

  1. #This Script is for Trumpet Winsock Ver. 2.0 Rev. A
  2. #
  3. #
  4. #trace on
  5. #
  6. # set up some strings for dialling up
  7. #
  8. if ![load $number]
  9.   if [query $number "Enter your dial up phone number"]
  10.     save $number
  11.   end
  12. end
  13. if ![load $username]
  14.   if [username "Enter your login username"]
  15.     save $username
  16.   end
  17. end
  18. if ![load $password]
  19.   if [password "Enter your login password"]
  20.     save $password
  21.   end
  22. end
  23. #$modemsetup = "&c1&k3"
  24. $prompt = "annex:"
  25. $userprompt = "sername:"
  26. $passprompt = "assword:"
  27. $choiceprompt = "hoice:"
  28. $slipcmd = "slip"
  29. $addrtarg = "Your address is"
  30. $pppcmd = "ppp"
  31. $pppready = "ppp."
  32. %attempts = 60
  33. #
  34. #
  35. #----------------------------------------------------------
  36. #
  37. # initialize modem
  38. #
  39. output "atz"\13
  40. if ! [input 10 OK\n]
  41.   display "Modem is not responding"\n
  42.   abort
  43. end
  44. #
  45. # setup our modem commands
  46. #
  47. output "at"$modemsetup\13
  48. input 10 OK\n
  49. #
  50. # send phone number
  51. #
  52. %n = 0
  53. repeat
  54.   if %n = %attempts
  55.     display "Too many dial attempts"\n
  56.     abort
  57.   end
  58.   output "atdt"$number\13
  59.   %ok = [input 60 CONNECT]
  60.   %n = %n + 1
  61. until %ok
  62. input 10 \n
  63. #
  64. #  wait till it's safe to send because some modem's hang up
  65. #  if you transmit during the connection phase
  66. #
  67. wait 30 dcd
  68. #
  69. # now prod the terminal server
  70. #
  71. output \13
  72. #
  73. #  wait for the username prompt
  74. #
  75. input 30 $userprompt
  76. output $username\13
  77. #
  78. # and the password
  79. #
  80. input 30 $passprompt
  81. output $password\13
  82. #
  83. # we are now logged in
  84. #
  85. input 30 $choiceprompt
  86. if %ppp
  87.   #
  88.   # jump into ppp mode
  89.   #
  90.   output $pppcmd\13
  91.   #
  92.   input 30 \n
  93.   #
  94.   display "PPP mode selected.  Will try to negotiate IP address."\n
  95.   #
  96. else
  97.   #
  98.   # jump into slip mode
  99.   #
  100.   output $slipcmd\13
  101.   #
  102.   # wait for the address string
  103.   #
  104.   input 30 $addrtarg
  105.   #
  106.   # parse address
  107.   #
  108.   address 30
  109.   input 30 \n
  110.   #
  111.   # we are now connected, logged in and in slip mode.
  112.   #
  113.   display \n
  114.   display Connected.  Your IP address is \i.\n
  115. end
  116. #
  117. # now we are finished.
  118. #
  119.