Date: Wed, 10 Aug 2005 00:00:09 +0200 From: Stefan Bethke <stb@lassitu.de> To: Jeremie Le Hen <jeremie@le-hen.org> Cc: drvince@anonymnet.net, freebsd-current@freebsd.org Subject: Re: More into /etc/rc.d/jail Message-ID: <10B8284B-6366-40A7-B426-C646D9653FFA@lassitu.de> In-Reply-To: <20050809215233.GB45385@obiwan.tataz.chchile.org> References: <N1-uLBXxM-zn8@Safe-mail.net> <96153776-0BE4-456F-B573-042E84730DFE@lassitu.de> <20050809215233.GB45385@obiwan.tataz.chchile.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Am 09.08.2005 um 23:52 schrieb Jeremie Le Hen:
> Hi Stefan,
>
>
>> #!/bin/sh
>> #
>> # $Id$
>> #
>>
>> # PROVIDE: mdconfig
>> # REQUIRE: mountcritlocal
>> # BEFORE: jail
>> # KEYWORD: nojail shutdown
>>
>> . /etc/rc.subr
>>
>> name="mdconfig"
>> start_cmd="mdconfig_start"
>> stop_cmd="mdconfig_stop"
>>
>> mdconfig_start()
>> {
>> if ! checkyesno mdconfig_enable; then
>> return 0
>> fi
>> sed -e 's/#.*$//' <${mdconfig_conf} |grep -v '^[[:space:]]*$'
>> >/tmp/mdconfig.$$
>>
>
> FYI, this could be written with one sed(1) command :
>
> sed -E '/^[[:space:]]*(#.*)?$/d' < ${mdconfig_conf} > /tmp/
> mdconfig.$$
Thanks for the hint!
Our little script certainly isn't meant as a prime example; I just
thought that it might be helpful as a starting point...
Stefan
--
Stefan Bethke <stb@lassitu.de> Fon +49 170 346 0140
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?10B8284B-6366-40A7-B426-C646D9653FFA>
