On Fri, Jul 19, 2002 at 01:53:13PM +0200, Per olof Ljungmark wrote:
> At 12:10 7/19/2002 +0100, Daniel Bye wrote:
> >On Fri, Jul 19, 2002 at 12:58:42PM +0200, Per olof Ljungmark wrote:
> >> Hi all,
> >>
> >> I am using apcupsd installed from ports with no mods.
> >> apcupsd itself runs fine but the script /usr/local/etc/rc.d/apcupsd.sh
> >> returns:
> >> apcupsd.sh: Cannot determine the PREFIX
> >> when I try it.
> >> I assume there are some Linux specific paths in there?
> >
> >
> >How are you calling the script?  You must give the absolute path on
> >the command line, or the first block (if ! ...) will make it bomb out
> >with the error message.
> >
> >HTH
> >
> >Dan
> 
> You are correct.
> /usr/local/etc/rc.d/apcupsd.sh start|stop
> will work.
> Now, how would I modify the script to make "sh apcupsd.sh start|stop" 
> executed from /usr/local/etc/rc.d/ work?

You can remove the first if block, but I would recommend you leave it
as is - all the scripts installed in /usr/local/etc/rc.d tend to run
this check, so I guess for sanity's sake rc must make use of it to 
ensure it is running a valid script.  If it really bugs you typing the
full path, I guess you could try a shell alias?  This will work, in
sh or bash:

# alias apcupsd="/usr/local/etc/rc.d/apcupsd.sh $@"

Dan

-- 
Daniel Bye

PGP Key: ftp://ftp.slightlystrange.org/pgpkey/dan.asc
PGP Key fingerprint: 3D73 AF47 D448 C5CA 88B4 0DCF 849C 1C33 3C48 2CDC
                                                                     _
                                              ASCII ribbon campaign ( )
                                         - against HTML, vCards and  X
                                - proprietary attachments in e-mail / \

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

Reply via email to