home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / orionup.zip / autoppp.cmd < prev    next >
OS/2 REXX Batch file  |  1997-10-12  |  3KB  |  100 lines

  1. /* BV PPP Door v1.0 */
  2.  
  3. ARG line
  4.  
  5. CALL AdeptLog Line, 3, '       ---==> BV PPP Door v1.0 <==---'
  6. CALL AdeptLog Line, 3, '   Copyright: B.V. Compuworks Group 1997'
  7. CALL AdeptLog Line, 3, '           WWW: BVCompuworks.com'
  8. /* CALL AdeptPrint line, '        One of the Best PPP Doors for AdeptXBBS!\r\n'*/
  9.  
  10. IF line = 0 THEN
  11.   DO
  12.     CALL AdeptLog Line, 3, 'BV-PPP: NO LOCAL PPP SUPPORT!'
  13.     Call ShowScreens
  14.     EXIT 0
  15.   END
  16.  
  17. /* CALL AdeptLog Line, 3, 'BV-PPP: Doing Config' */
  18. IF line = 1 THEN
  19.   CALL AdeptPrint line, '             ---==> BV PPP Door v1.0 <==---\r\n'
  20.  
  21. /* ---- Begin Configuration ------------------------------------------------- */
  22.  
  23. /* BBS IP Address                  */  IP_Address     = '209.17.168.106'
  24.  
  25. /* Min Sec 1 Level to Access PPP   */  Min_Sec_Access = '20'
  26.  
  27. /* IP Addresses for Nodes          */  Node.1.IP      = '209.17.168.107'
  28. /* ->A '' Means they can not use   */  Node.1.COM     = 'com2'
  29. /*   PPP On this node!             */  Node.2.IP      = '209.17.168.108'
  30. /* ->Make sure you have EVERY node */  Node.2.COM     = 'com4'
  31. /*   Set up here!!!!!              */  Node.3.IP      = ''
  32. /* ->COM4 is incorrect!!! It needs */  Node.3.COM     = ''
  33. /*   to be in lower case! (com4)   */
  34.  
  35. /* Dir you put BV PPP into         */  PPPDir         = 'E:\Adept\BVPPP\'
  36. /* Same but for adept's /'s        */  PPPDir2        = 'E:\\Adept\\BVPPP\\'
  37. /* Welcom Screen                   */  WelcomeScreen  = 'Greet.asc'
  38. /* News Screen                     */  NewsScreen     = 'gen_news.asc'
  39. /* BulletinScreen                  */  BulletinScreen = 'Sign.asc'
  40. /* ---- End of Configuration ------------------------------------------------ */
  41.  
  42. /* CALL AdeptLog Line, 3, 'BV-PPP: Config Done' */
  43.  
  44. IF line = 0 THEN
  45.   DO
  46.     CALL AdeptLog Line, 3, 'BV-PPP: NO LOCAL PPP SUPPORT!'
  47.     Call ShowScreens
  48.     EXIT 0
  49.   END
  50.  
  51. UserName = AdeptGetVar(Line,1)
  52. UserSecLevel = AdeptGetVar(Line,40)
  53.  
  54. IF (UserSecLevel < Min_Sec_Access) THEN
  55.   DO
  56.     CALL AdeptLog Line, 3, 'BV-PPP: User DOES NOT have PPP Access.'
  57.     Call ShowScreens
  58.     EXIT 0
  59.   END
  60.  
  61. CALL AdeptLog Line, 3, 'BV-PPP: User has PPP Access...'
  62.  
  63. IF (Node.line.IP = '') THEN
  64.   DO
  65.     CALL AdeptLog Line, 3, 'BV-PPP: This line does not support PPP.'
  66.     Call ShowScreens
  67.     EXIT 0
  68.   END
  69.  
  70.  
  71. ret = AdeptSetGlobalVar('PPP'line, 'ACTIVE')
  72. CALL AdeptLocation line, "Using PPP"
  73.  
  74. ThreadID = AdeptStartRexxThread(PPPDir||'Connect.cmd', Line IP_Address || ':' || Node.Line.IP Node.line.COM PPPDir2)
  75. If ThreadID <= '0' Then Do
  76.   CALL AdeptLog Line, 3, 'BV-PPP: Cannot start thread cmd file.  Check path of Connect.cmd'
  77.   CALL AdeptPrint Line, '\r\n' || 'PPP ERROR - cannot start thread, notify the Sysop.'
  78.   CALL AdeptSleep Line, 3000
  79.   EXIT -2
  80. END
  81.  
  82. DO FOREVER
  83.   IF AdeptGetVar(Line,276) = 0 THEN /* Check Carrier */
  84.     DO
  85.       CALL AdeptLog Line, 3, 'BV-PPP: 'UserName' has dropped carrier!!!'
  86.       ret = AdeptDropGlobalVar('PPP'line)
  87.       EXIT -2
  88.     END
  89.   status = AdeptGetGlobalVar('PPP'line)
  90.   IF status = 'INACTIVE' THEN
  91.     DO
  92.       CALL AdeptLog Line, 3, 'BV-PPP: 'UserName' has dropped carrier or PPP was killed off'
  93.       CALL AdeptComDoDTR Line, 0
  94.       ret = AdeptDropGlobalVar('PPP'line)
  95.       RETURN -2
  96.     END
  97.   CALL AdeptSleep Line, 500
  98. END
  99.  
  100.