Date: Wed, 14 Apr 2004 17:31:36 -0500 From: Dan Nelson <dnelson@allantgroup.com> To: Nguyen Tam Chinh <chinhngt@sectorb.msk.ru> Cc: freebsd-hackers@freebsd.org Subject: Re: C code for parsing rc.conf? Message-ID: <20040414223136.GG28745@dan.emsphone.com> In-Reply-To: <20040415021631.N1878@chinhngt.b.gz.ru> References: <20040414215601.GA3923@crodrigues.org> <20040415021631.N1878@chinhngt.b.gz.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Apr 15), Nguyen Tam Chinh said: > On Wed, 14 Apr 2004, Craig Rodrigues wrote: > > Is there a C library that comes with FreeBSD which can be used to > > parse, append to, and validate rc.conf? > > > > I'd like to customize some of the settings in /etc/rc.conf with my > > own GUI-based program. It's not too hard to write something on my > > own, but I was wondering if a reusable library existed in FreeBSD > > 4.x or 5.x for doing this. > > rc.conf is parsed/executed by scripts in /etc/rc*. With your GUI > program, simply take and change these scripts. .. and be aware that although most lines will be in the standard name="value" format, admins are free to put any shell syntax or commands they like in there. So make sure your gui tool preserves unchanged lines when saving (instead of regenerating the entire file from a parsed array, for example). That will let an admin use shell tricks to generate ifconfig_XX0_aliasXX variables, for example, and still allow using your tool to change moused flags. -- Dan Nelson dnelson@allantgroup.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040414223136.GG28745>