More into /etc/rc.d/jail

Jeremie Le Hen jeremie at le-hen.org
Tue Aug 9 21:52:22 GMT 2005


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.$$

-- 
Jeremie Le Hen
< jeremie at le-hen dot org >< ttz at chchile dot org >


More information about the freebsd-current mailing list