home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Crawly Crypt Collection 1
/
crawlyvol1.bin
/
bbs
/
citadel2
/
bat_hint.doc
< prev
next >
Wrap
Text File
|
1989-12-01
|
4KB
|
95 lines
/************************************************************************/
/* Bat-Hint.doc */
/************************************************************************/
No program is ever bug-free. However, it is nice to pretend that one
is, and an effective way to pretend that a particular program has achieved
such a goal is by never having it require your attention when you are
attending to other things.
Citadel-68 tries to emulate this sort of software by returning a value
to GEMDOS when it terminates gracefully. There are 4 possible values
returned by Citadel-68 that can be read by a GEMDOS batch file (provided,
of course, that you are using a batch processor that can handle it.):
0 -- indicates that the sysop requested that the program terminate.
1 -- indicates that the system terminated due to the TIMEOUT parameter
in CTDLCNFG.SYS.
2 -- indicates ABNORMAL termination, i.e., the system had an error of some
sort and has crashed gracefully.
3 -- indicates that a Remote sysop has taken the system down via Remote
sysop capabilities.
Furthermore, Citadel-68, when called with ANY argument(s) on the command
line, will leave message in the Aide> room notifying the aides that the
system came up at the time specified in the message header. The argument
itself doesn't matter; it's presence on the command line is the important
part.
And, plus, when CONFIGUR is called with any argument(s) (just like CITADEL,
above), it will assume that it is in unattended mode, and will not ask the
sysop if he wants to erase the files; it will assume that since the sysop is
not around, he wants to preserve his data files, and just scans the files.
What can you do with the above? The following examples are from the
Citadel-86 (MS-DOS) documentation -- similar things can be done with GEMDOS.
> NOTE: All following examples pre-suppose that CITADEL and CONFIGUR are on
> drive A.
>
> Suppose we're running with TIMEOUT set to 0. We'd set up two batch files:
>
> RUNIT.BAT would contain
>
> :loop
> CITADEL %1 <-- if runit gets argument, recovering from cr.
> if errorlevel 3 goto remotedown <-- CTDL terminated by Remote sysop.
> if errorlevel 2 fixit <-- CTDL terminates with crash.
> if errorlevel 1 goto ridiculous <-- shouldn't terminate with timeout.
> if errorlevel 0 goto done <-- sysop termination, just leave.
> :remotedown <-- brought down by remote, so we'll have it
> generic <-- run "something" and then restart Citadel.
> goto loop <-- Now restart Citadel
> :ridiculous <-- tell sysop impossibility occurred.
> rem This is an impossible condition!
> :done
>
> and FIXIT.BAT would contain
>
> CONFIGUR N <-- Call configuration with unattended arg.
> RUNIT SSS <-- Call runit with crash argument.
>
>
> Suppose we're running with TIMEOUT set to 1, and the SYSDISK files are on
> drive C (a RAM disk, which is the usual reason for TIMEOUT). There would
> be 3 batch files, and they would look like this:
>
> RUNIT.BAT
> c:
> a:CITADEL %1
> a:
> if errorlevel 3 goto weird
> if errorlevel 2 fixit
> if errorlevel 1 copyctdl
> if errorlevel 0 goto done
> :weird <-- Assume no Remote sysop abilities
> REM This shouldn't have happened! <-- allowed for this installation.
> fixit
> :done
>
> FIXIT.BAT
> CONFIGUR N
> RUNIT SSSS
>
>
> COPYCTDL.BAT
> rem assume that you would copy from drive c to drive a
> a:
> COPY C:*.SYS
> RUNIT
>
>
> Always remember that the MSDOS 'if' command doesn't test for values, it
> tests for levels, so series of 'if errorlevel' statements should always
> start with the highest possible errorlevel and proceed downward.