home *** CD-ROM | disk | FTP | other *** search
/ Quarterdeck InternetSuite / Quarterdeck InternetSuite.iso / qsockpro.qip / ICNET.MPS < prev    next >
Encoding:
Text File  |  1996-03-20  |  1.7 KB  |  69 lines

  1. # IC Net PPP and SLIP login script
  2. # Copyright 1995 Quarterdeck Corporation
  3. # 5-9-95 BPD
  4.  
  5. #define the variables we will need
  6.  
  7. STRING username
  8. STRING password
  9. STRING framing
  10. STRING IPAddress
  11.  
  12. # uncomment for debugging
  13. # TRACE ON
  14.  
  15. # reset maximum login timeout. 
  16. SetTimeout 90
  17.  
  18. # Get username from access method
  19. CfgGetValue "Username" username
  20.  
  21. # if the Username field is empty, prompt the user for it.
  22. IF result = 0 THEN
  23.     GetInput "Enter your user name" username
  24.     IF result = 0 THEN
  25.         PRINT "Warning, no username entered"
  26.     ELSE
  27.         PRINT "Username set to ["; username; "]"
  28.     ENDIF
  29. ENDIF
  30.  
  31. # get password from access method
  32. CfgGetValue "Password" password
  33.  
  34. # if the Password field is empty, prompt the user for it.
  35. IF result = 0 THEN
  36.     GetPassword "Enter your password" password
  37.     IF result = 0 THEN
  38.         PRINT "Warning, no password entered"
  39.     ELSE
  40.         PRINT "Password set."
  41.     ENDIF
  42. ENDIF
  43.  
  44. # get framing layer (MPPPP, MPSLIP)
  45. # abort with an error if we can't read the Framing setting
  46. CfgGetValue "Framing" framing
  47. IF result = 0 THEN
  48.     ABORT "Can't read 'Framing' setting from qdeck.ini"
  49. ENDIF
  50.  
  51. CommWaitFor "Gateway>"           # wait for login prompt
  52.     CommSend username            # send user name
  53.     CommSend "%r"                # send carriage return
  54.  
  55. CommWaitFor "Password:"          # wait for password prompt
  56.     CommSend password            # send password
  57.     CommSend "%r"                # send carriage return
  58.  
  59. IF framing = "MPSLIP" THEN
  60.     CommWaitFor "to"
  61.     CommReadIPAddr IPAddress
  62.     IF result>0 THEN
  63.         CfgSetValue "IPAddress" IPAddress
  64.         PRINT "%rIP Address set to ["; IPAddress; "]"
  65.     ENDIF
  66. ENDIF
  67.  
  68. END                              # indicate success if we got this far
  69.