Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 Mar 2006 14:39:17 +0200
From:      "Frans Haarman" <franshaarman@gmail.com>
To:        freebsd-questions@freebsd.org
Subject:   rcng, addition to rc.subr
Message-ID:  <b039b5c70603310439m18ee824ev6a65a26a59dfcacd@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
I am changing /etc/rc.subr. I can now use rc.env.d directories. Each file i=
n the
directory becomes a variable. somewhat like daemontools envdir. It
seemed nice to
include it to rcng.

So with this we can do:

echo 'yes' > rc.env.d/sshd/sshd_enable

Am concidering adding the "$_command'
name to the variables if there is no _ in the file name.

Then we could do:

echo yes > rc.env.d/sshd/enable


Here is the script:

#custom rc.env.d
#used to overide/configure last variables using rc.env.d

if [ -d /data/etc/rc.env.d/"$_command" ]; then

=09debug "rc.env.d /data/etc/rc.env.d/${_command}"
=09envd_vars=3D`ls /data/etc/rc.env.d/"${_command}"`=09#each file is a var
=09for envd_file in $envd_vars
=09do
=09=09if [ -f /data/etc/rc.env.d/"$_command"/$envd_file ]; then
=09=09  export $envd_file=3D`head -1 /data/etc/rc.env.d/${_command}"/$envd_=
file`
=09=09fi
=09done

=09#echo "rc.env.d /data/etc/rc.env.d/${_command}"
fi


Does this look ok to you ?

Regards,
Frans



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?b039b5c70603310439m18ee824ev6a65a26a59dfcacd>