home *** CD-ROM | disk | FTP | other *** search
- @echo off
- REM Set environment variables.
- SET RA=d:\bbs\RA
-
- :Start
- REM Start the main batch file loop.
- Cls
- Echo Starting RemoteAccess Node %1
- CD \bbs\RA\NODE%1
- \bbs\RA\RA -E10 -N%1
- REM After RA exits, trap the errorlevel.
-
- :AfterRA
- IF ERRORLEVEL 20 GOTO Maintain
- IF ERRORLEVEL 10 GOTO Start
- IF ERRORLEVEL 2 GOTO Local
- IF ERRORLEVEL 0 GOTO Quit
-
- :Maintain
- REM Since this is a multi-node system, we
- REM should leave maintenance tasks to one
- REM node only to avoid having two nodes
- REM performing the same tasks at the same
- REM time. If node 2 is running the event,
- REM it will stop and wait until node 1 is
- REM finished. It then continues batch file
- REM execution.
- CD \bbs\RA
- REM If not node 1 go wait while node 1 does
- REM maintenance tasks.
- IF NOT %1 == 1 GOTO Wait
- REM Create a semaphore file called
- REM RAWAIT.SEM
- ECHO ... >RAWAIT.SEM
- REM Pack the user database deleting users
- REM who have not called in 60 days. Also
- REM sort the user file.
- RAUSER -S -P -D60
- REM Pack the message database purging
- REM messages according to the threshold
- REM information contained in MESSAGES.RA.
- REM Renumber the database updating reply
- REM chains and user LastRead pointers.
- RAMSG PACK -Purge -Renumber
- REM This concludes maintenance tasks.
- REM Delete the semaphore file and then
- REM recycle the batch file.
- ERASE RAWAIT.SEM
- GOTO Start
-
- :Local
- REM Local logon mode
- CD \bbs\RA\NODE%1
- \bbs\RA\RA -E10 -L -N%1
- REM When finished, goto AfterRA to trap
- REM the errorlevel returned.
- GOTO AfterRA
-
- :Wait
- REM Wait here until the file RAWAIT.SEM
- REM no longer exists
- IF EXIST RAWAIT.SEM GOTO Wait
- REM If it doesn't exist, recycle.
- Goto Start
-
- :Quit
- REM Exit the batch file.
-