home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 2 BBS
/
02-BBS.zip
/
mkarea10.zip
/
makearea.doc
< prev
next >
Wrap
Text File
|
1995-06-10
|
8KB
|
205 lines
MakeArea.Cmd
OS/2 REXX Script
to automate adding new echomail areas
to Squish and Maximus
Copyright 1995, Herman Freeman
MakeArea.Cmd is a REXX script intended to automate the addition
of new echomail areas to a Maximus/Squish based BBS. It
automatically scans the Bad Messages area maintained by Squish,
creating new Echoarea entries in both Squish.Cfg and MsgArea.Ctl
files based on information found in the Elist.Dat file (produced
and copyrighted by Michael Fuchs).
I created MakeArea.Cmd because Fidonet is constantly adding new
echo areas to the backbone, and messages for these new areas
were piling up in my bad message area until I got busy and
edited them into the Squish.Cfg and MsgArea.Ctl files, ran Silt,
and corrected the usual mess of errors in my text-work.
MakeArea.Cmd can be used in a normal batch process to completely
automate the detection and creation of new echo areas in a very
consistent way. Since MakeArea returns an errorlevel of 0 if no
new areas are created, or 1 if new areas are created, the
errorlevel exit can be used to control the batch process.
INVENTORY:
this archive contains the following files:
MAKEAREA.CMD - the actual script file
MAKEAREA.CFG - the sample control file
MAKEAREA.DOC - this document
MECCA.PRE - Mecca command prefix file sample
other files may also be included, but these files are required.
FUNCTION:
MakeArea.Cmd, using info you provide in the Makearea.Cfg file,
scans the Bad Messages directory where Squish tosses Echomail
messages if the echo tag is not set up. If MakeArea finds *.msg
files in this directory, the messages are parsed to extract the
echo tags and the uplink address. The uplink address is assumed
to be the LAST entry in the PATH: kludge of the message.
Having now extracted the echo tags and addresses, MakeArea
reads the file ELAREA.DAT, a comma-delimited text database
created by Michael Fuchs and updated monthly. This useful file
contains lots of useful info about all E-Listed echo areas. If
an entry is found in the ELAREA.DAT file which matches a tag
found in a bad message, an entry is written to SQUISH.CFG and
MSGAREA.CTL to create the area.
MakeArea uses the Key field from the ELAREA.DAT file for several
purposes:
To build the path to the files in Squish.Cfg
To name the Area in Maximus
to name the description files
MakeArea uses the Title field from ELAREA.DAT to construct the
MsgInfo line in the MSGAREA.CTL entry.
MakeArea uses the Description field from ELAREA.DAT to construct
a mecca-formatted description file which can be display to the user.
The database entry for the area also determines whether the area
is set as Read-Only and determines the user-priviledge level
required to access the area. If the Description field contains
the phrase 'Read-Only' then the area is made read-only. If the
FlagSysopOnly field is set to 'Y' then the user-priv level for
the area is set to the value defined by the 'SysopUserPriv'
keyword in the MakeArea.Cfg file.
CONFIGURATION:
MakeArea is configured using an external configuration file.
The default for the configuration file is to search for
'MakeArea.Cfg' in the logged directory. You can overide the
default by specifying a different file as the first parameter on
the command line. The name of an alternate configuration file
is the only command-line parameter used by MakeArea. Alternate
configuration files allows you to process different Mail paths,
mecca suffix/prefixes, and so forth. You may not need this, but
if you get adventurous, there it is.
If no configuration file is found in the logged directory, and
none is passed to MakeArea as a command-line parameter, MakeArea
will run using the internal defaults. Don't, however, expect much.
The sample MakeArea.Cfg file includes examples of each
configuration keyword used by MA, an example of its use, and and
explanation of its purpose. The sample file is self-documented.
Entries in the file are case-insensitive.
I suggest that you run MakeArea a few times with the SquishCfgFile
and the MsgAreaCtlFile keywords remarked out so you can see what
will happen before you point it at your real Squish.Cfg and
MsgArea.Ctl files.
the following skeleton for a batch .cmd file suggests how to set
up MakeArea.Cmd:
Sq386p In Out Squash Link 'Normal Squish processing'
.
call MakeArea.Cmd 'auto-add new areas'
if errorlevel=0 goto Skip 'no new areas: quit'
.
Sq386p In Link 'toss new areas'
.
Siltp Max -u 'Silt in new areas'
.
:Skip 'go here when done'
.
and so on....
DESCRIPTION FILES:
MakeArea can write out the long description of an area it
creates as a formatted, word-wrapped mecca-displayable <.BBS>
file. I did this so that my bbs can display a detailed
description of echo areas to users on demand. The files pointed
to by the 'MeccaPrefixFile' and 'MeccaSuffixFile' keywords in
the configuration file are prepended and appended to the
description file as-is when the description file is written.
These prefix and suffixes allow you to set colors, set or test
keys, display headers, or anything else allowed by mecca. My
sample Quits (doesn't display) the description file if the user
doesn't have the 'D' key set, and sets the display color to
magenta. This allows a menu function which toggles display of
the description file. Neither the prefix or suffix files are
required, and default to NUL:.
KNOWN PROBLEMS:
MakeArea will build a new area from information contained in the
FIRST matching entry in the ELAREA.DAT file. Sometimes, there
is more than one entry with the same echo tag in the ELAREA.DAT
file. This isn't a problem here, but your mileage may vary.
MakeArea will happily create duplicate entries in both your
Squish.Cfg file and your MsgArea.Ctl file if you fail to run
Squish between executions of MakeArea. You should run Squish
after running MakeArea, if the exit errorlevel is not 0.
REGISTRATION:
MakeArea is freeware, but not Public Domain. You may use
MakeArea as you wish, and change it if you wish, so long as you
acknowledge the original copyright in your modified version.
If you find MakeArea useful, I ask that you send a netmail
message to me at the following address:
1:308/90 Fidonet
Herman Freeman
If you have suggestions, or find serious flaws in the operation
of MA, feel free to netmail suggestions to the same Fidonet
address. I don't promise to fix anything, but if I can see a
solution, I'll try, and if you have an interesting suggestion,
I'll try to implement it.
ACKNOWLEDGEMENTS:
Scott Dudley is the creator and copyrighter of Maximus, Squish,
and Mecca. Thanks, Scott, for a very flexible and trouble-free
product.
REXX and OS/2 are copyright IBM corp. Thank them, too. OS/2 is
neat.
CAVEAT:
MakeArea.Cmd is my first attempt to do anything useful with
Rexx. It is very different than any other language I've used,
as it is 'Word/Text' oriented. While I <Think> I came up with
good solutions to various programming problems, I'm sure there
are many plainly hideous ideas in MakeArea.Cmd, and I'm equally
sure that I've made some assumptions about the files parsed by
MakeArea that I'll regret, probably tomorrow.