home *** CD-ROM | disk | FTP | other *** search
/ Netware Super Library / Netware Super Library.iso / timevent / taskmstr / nliclear.tsk < prev    next >
Encoding:
Text File  |  1995-05-07  |  1.6 KB  |  61 lines

  1. /////////////////////////////////////////////////////////////////
  2. // This .TSK file will search all valid connections looking for a
  3. // NOT-LOGGED-IN connection which it will then clear.
  4. /////////////////////////////////////////////////////////////////
  5.  
  6.  
  7. // First, define user variable %0 to the first valid connection
  8.  
  9. DEFINE %0 0001
  10.  
  11.  
  12. // Next, loop through the connections until %0 is > %CONNS_PEAK%
  13.  
  14. WHILE %0<=%CONNS_PEAK%
  15.  
  16.  
  17.   // Now, define user variable %1 to the user name logged into the
  18.   // connection (%1 will equal NOT-LOGGED-IN is the connection is
  19.   // active but no one is logged in and %1 will equal INACTIVE if
  20.   // the connection is not currently in-use/allocated)
  21.  
  22.   DEFINE %1 %CONN_NAME_%0%
  23.  
  24.  
  25.   // Check if the conection is INACTIVE or NOT-LOGGED-IN
  26.   // (NOTE: This IF/ELSE/ENDIF block uses the default format.)
  27.  
  28.   IF %1==INACTIVE OR %1==NOT-LOGGED-IN
  29.  
  30.  
  31.     // This ECHO command will only execute if the connection is
  32.     // INACTIVE or NOT-LOGGED-IN
  33.  
  34.     ECHO Connection %0 is currently %1
  35.  
  36.  
  37.     // Check if the connection is NOT-LOGGED-IN.  If so, clear it!
  38.     // (NOTE: This IF/END block uses the System Login Script format.)
  39.  
  40.     IF %1==NOT-LOGGED-IN THEN BEGIN
  41.       ECHO Clearing connection %0
  42.       CLEAR STATION %0
  43.     END
  44.  
  45.  
  46.   ELSE
  47.  
  48.     // This ECHO command will only execute if the connection has
  49.     // an active user connection
  50.  
  51.     ECHO Connection %0 in use by %1 (ID: %CONN_ID_%0%) on %CONN_ADDRESS_%0%
  52.   ENDIF
  53.  
  54.  
  55.   // Finally, increment %0 and repeat the loop
  56.  
  57.   DEFINE %0 %0+=1
  58.  
  59. LOOP
  60.  
  61.