Monthly Archives: April 2010

jails2xml ready for review!

Ok, so after som nice flow and a whole lot of code cleanup I think it is actually presentable now.
So without any further ado, get a copy at , give it a try and please give me some feedback.
There are a couple of things to be added and updated, this is not “finished”. (like splitting config options at the top to a separate file and giving better granularity to the host info added to the xml.)
But I wanted the chance to get feedback as soon as possible and also might not have as much time to work on this as I would like for a while.

Short description:
This script will with its default options run through your /usr/local/etc/ezjail/ directory and add all the set options for each jail to an xml file called jails.xml in the current directory.
It will also add some info about the host system, and the time of creation of the xml.
So far tested successfully on systems running 7.2-R and 8.0-R.

An anonymized sample of a jails.xml with a single jail configured on the host:
<?xml version="1.0" encoding="iso-8859-1"?>
<exec>/bin/sh /etc/rc</exec>
<allinfo>FreeBSD 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #0: Tue Jan  5 16:02:27 UTC 2010     [nohide][/nohide]:/usr/obj/usr/src/sys/GENERIC  i386</allinfo>
<verbose>FreeBSD 8.0-RELEASE-p2 #0: Tue Jan  5 16:02:27 UTC 2010     [nohide][/nohide]:/usr/obj/usr/src/sys/GENERIC </verbose>
<generated>Tue Apr  6 20:02:39 CEST 2010</generated>

And just to make sure I am clear about this. This is for FreeBSD systems running jails via the ezjail administration framework.


shell expansion within awk

Say you have a loop in a shell script and want to expand a given variable within an embedded awk statement, this is how:

awk 'BEGIN { FS = "'${i}'" } do some more awking'
In this case $i is my shell variable, and I want to use it as a field separator.

It is just that easy, an extra ‘ to escape awk for a moment and expand $i!


bontmia downloads

Yay, during march I had over 100 downloads of my bontmia port for FreeBSD.
Thats a new record and actually pretty motivating.

downloads during march

I have intended to write something about bontmia for a long time now, but there is more pressing issues at hand so check out the FAQ and Usage pages for now..