Date: Mon, 15 Dec 2003 23:06:13 -0800 (PST) From: Nate Lawson <nate@root.org> To: Mike Makonnen <mtm@identd.net> Cc: acpi-jp@jp.freebsd.org Subject: Re: Power profile script Message-ID: <20031215230535.S65338@root.org> In-Reply-To: <20031215095238.GB840@mobile.acsolutions.com> References: <20031213130351.N59162@root.org> <20031215095238.GB840@mobile.acsolutions.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 15 Dec 2003, Mike Makonnen wrote: > On Sat, Dec 13, 2003 at 01:12:03PM -0800, Nate Lawson wrote: > > > > I'm mostly looking for style input on the /etc/power_profile script since > > I'm not familiar with our scripting guidelines. Note that it's called > > from devd (or manually by the user) and is not an rc.d boot-time thing. > > /etc/rc.d is not just for boot time scripts. You can put 'nostart' in > the script's KEYWORD section if you don't want it processed at boot time. > My personal feeling is that if it is configured through rc.conf then it > should go in /etc/rc.d, but I won't insist on it. > > > + > > +# Pull in default values. > > +if [ -r /etc/defaults/rc.conf ]; then > > + . /etc/defaults/rc.conf > > + source_rc_confs > > +elif [ -r /etc/rc.conf ]; then > > + . /etc/rc.conf > > +fi > > Please source /etc/rc.subr and use the load_rc_config() routine > to do this. Usage: load_rc_config $command. If you don't want > it to source a /etc/rc.conf.d/$command file, then just use 'XXX' > as its argument. > > > + > > +if [ $# -ne 1 ]; then > > + echo "Usage: $0 [0x00|0x01]" > > + exit 1 > > +fi > > There are also other convenience routines in that file > that you may wish to use. For example the err() routine > might be of use in the above situation. Ok, thanks for the comments. I'll address these and anything else I can pull from rc.subr and then run it by you before committing. -Nate
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031215230535.S65338>