sysconf -- a sysctl(8)-like utility for managing /etc/rc.conf
et. al.
Devin Teske
dteske at vicor.com
Tue Oct 12 00:38:40 UTC 2010
On Mon, 2010-10-11 at 13:33 -0700, Russell Jackson wrote:
> On 10/06/2010 01:45 PM, Devin Teske wrote:
> > Hello fellow freebsd-hackers,
> >
> > Long-time hacker, first-time poster.
> >
> > I'd like to share a shell script that I wrote for FreeBSD system
> > administration.
> >
> > The attached shell script works similar to sysctl(8), but rather than
> > querying or working on sysctl MIBs, it instead works on the /etc/rc.conf
> > (and /etc/rc.conf.local) files.
> >
>
> Have you looked at textproc/augeas? It's a more generic and extensible
> way to edit plain text configuration files programmatically using an
> xpath like syntax.
>
> Example
>
> # augtool get /files/etc/rc.conf/sshd_enable
> /files/etc/rc.conf/sshd_enable = YES
> # printf 'set /files/etc/rc.conf/sshd_enable NO\nsave\n' | augtool
> # augtool get /files/etc/rc.conf/sshd_enable
> /files/etc/rc.conf/sshd_enable = NO
>
>
> The tool itself is written in C and has no external dependencies. It is
> taught file grammar via "lenses" which are like formal language specs
> written in BNF.
>
> http://augeas.net/
>
Very cool. However...
$ uname -spr
FreeBSD 8.1-RELEASE-p1 amd64
$ which augtool
$ type augtool
-bash: type: augtool: not found
Not like I'm running bare...
$ pkg_info -Ia | wc -l
399
Unfortunately, augtool doesn't even appear to be packaged for FreeBSD:
$ pwd
/repos/FreeBSD-8.1/8.1-RELEASE/packages
$ ls | head -4
All
INDEX
MOVED
UPDATING
$ awk -F'|' '/augtool/ {print $1}' < INDEX
$ awk -F'|' '/lexx/ {print $1}' < INDEX
lexxia-0.901
$ awk -F'|' '/yacc/ {print $1}' < INDEX
afay-041111
byaccj-1.14
ebnf2yacc-0.1.1
lemon-1.69
ruby18-byaccr-0.1
showgrammar-1.1
cocor-1.7_1
Not as a binary package nor could I find it in the ports tree.
At this point, we're developing a script that is to be a candidate for
inclusion into the base-distribution of FreeBSD, so any/all use of
augtool is out unless it gets included in the base OS.
Thanks for the heads-up though... looks really powerful.
--
Cheers,
Devin Teske
-> CONTACT INFORMATION <-
Business Solutions Consultant II
FIS - fisglobal.com
510-735-5650 Mobile
510-621-2038 Office
510-621-2020 Office Fax
909-477-4578 Home/Fax
devin.teske at fisglobal.com
-> LEGAL DISCLAIMER <-
This message contains confidential and proprietary information
of the sender, and is intended only for the person(s) to whom it
is addressed. Any use, distribution, copying or disclosure by any
other person is strictly prohibited. If you have received this
message in error, please notify the e-mail sender immediately,
and delete the original message without making a copy.
-> END TRANSMISSION <-
More information about the freebsd-hackers
mailing list