[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

dcfgtool - another cfgtool

[ follow-up should go to debian-admintool ]


i wrote another admin tool. you can find it in incoming (or in experimental).
you can find it in Incoming (or experimental) as dcfgtool_0.1 (maybe
someone has a better name ?).

it's not well tested, and i still have to implement two functions
(--list and --exec), and i'm sure there are some bugs...

Features of dcfgtool

 - it's written in c. this way it should be fast enough.
 - it uses test file. everyone can change them with a text editor,
   or yust read them.
 - it is designed to store descriptions.
 - it uses paths as name, like "test/very/long/name/for/an/item". a part
   of this name is the filename (that could be "test" or "test/very"
   or ...), the rest is the name in the file ("very/long..." or
 - it can extract the whole database into a text file
 - it can create the whole database from a text file
 - it can update the whole database without overwriting values
 - you can set permissions : it uses text files. 
i wrote it, because i don't like cfgtool (no text file, no path for
variables) and i dont like nod (a script). 

what do you think about it ?
(discussion in debian-admintool)

regards andreas

some examples (not tested) :

/* read an item */
$ dcfgtool --get base/tmptime

/* what's this item ? */
$ dcfgtool --info base/tmptime
# Time files in /tmp are kept. 
# /tmp is cleaned every time you boot this system.
base/tmp 0

/* set an item */
$ dcfgtool --set base/tmptime=9

/* is this item "TRUE" or "FALSE" ? */
$ dcfgtool --get base/delaylogin
$ dcfgtool --is base/delaylogin && echo do_what_you_want

/* delete an item */
$ dcfgtool --delete base/delaylogin

/* make a backup */
$ dcfgtool --export > /some/where/backup.file

/* add new items (if they don't exist). update descriptions */
$ dcfgtool --import < /var/lib/dpkg/info/new_programm

/* copy config to a remote server (overwrite values) */
$ dcfgtool --export |rsh dcfgtool --update


the database files could look like : (/etc/config/boot)
# Time files in /tmp are kept.
tmptime 0

# Set to TRUE if you want sulogin to be spawned on bootup
sulogin FALSE
# Set to FALSE if you want to be able to login over telnet/rlogin
# before system startup is complete (as soon as inetd is started)
delaylogin TRUE

# Set GMT="-u" if your system clock is set to GMT, and GMT="" if not.
gmt "-u"

# Set VERBOSE to FALSE  if you would like a more quiet bootup.
verbose TRUE

# Set EDITMOTD to "FALSE" if you don't want /etc/motd to be editted
# automatically
editmotd FALSE

# here is a description for the file /etc/config/base.
# it's the comment without name/value pair.

Reply to: