On Thu, Jun 14, 2001 at 08:59:16PM +0200, Karsten W. Rohrbach wrote:
> Peter Pentchev([EMAIL PROTECTED])@2001.06.14 20:19:27 +0000:
> > OK, and what do I do if I want to manually start/stop the service later,
> > and it needs variables defined in /etc/rc.conf{,local} ?
> 
> if [ x${_RC_CONF} != x1 ]; then . /etc/rc.conf; fi
> 
> in the beginning of the local startup script?
> if it really requires it, it could plainly source it in the beginning,
> or selectively using the above if statement when /etc/defaults/rc.conf
> would do _RC_CONF=1; export _RC_CONF
> 
> that's not a very good idea, but it would - at least - fix the behaviour
> to be the right way. please read on...

Not really; it's a great start, but something like..

if [ -z "$_RC_CONF" ]; then
        . /etc/defaults/rc.conf
        if type source_rc_confs | fgrep "shell function" > /dev/null; then
                source_rc_confs
        else
                rc_conf_files=${rc_conf_files-'/etc/rc.conf /etc/rc.conf.local'}
                for i in $rc_conf_files; do
                        if [ -r "$i" ]; then
                                . "$i"
                        fi
                done
        fi
        _RC_CONF=1      # just in case..
fi
  
..would do the trick better :)

G'luck,
Peter

-- 
I am not the subject of this sentence.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to