Hi,
I have added "a few" lines to the serctl script, to support DBText.
I have tested it, and it seems to work just fine. Of course, the
output of certain commands is not as fancy as with MySQL, but
then, I could not come up with a way to port the sql query's to text
files :)
I have to say, also, that I did some other 'beauty' changes. For
example,
i converted all the spaces into tabs, for indentation purposes.
Also, some of the echoed messages i have added some carriage returns,
just to make the output look "better". And rewritten a few lines in the
usage function.
How to get it to work?
To use dbtext instead of mysql, the scripts needs a variable "SER_DB",
to
be set to SER_DB="dbtext". If not found, it creates it and defaults to
SER_DB="mysql".
Also, if using dbtext, we need the path to access the files. Set
DBTEXT_PATH="/path/to/dbtext" (it defaults to
/usr/local/etc/ser/dbtext)
I added a command to serctl ("serctl dbtext [dbtext_path]"). When
called, it
creates the needed dbtext files (it dumps the first line, where the
fields are
described). They are in the same order as in the mysql tables.
The rest is just as with mysql. I did not add any feature, not remove
any (i think).
Whenever it is turn to write to a mysql table, instead, the dbtext
files are edited
(no locking mechanism for the files, sorry).
Can someone give it a try? I don't think many people use dbtext, but it
is nice to
have it supported in serctl. And maybe it can make its way to the cvs
...
Regards,
Cesc Santa
PS - If you test it and find bugs, please, give me feedback to improve
it.
PS2 - I would provide a diff ... but for some reason, it just doesn't
work in my linux.
Too many changes? it would just delete the old file, and write
all the new lines :)
unclassified
Attachments:
- sc.dbtext
(application/octet-stream — 31.3 KB)