Date: Tue, 9 Oct 2001 14:35:14 -0700 From: "george" <george@vagner.com> To: "Kevin Golding" <kevin@caomhin.demon.co.uk> Cc: <questions@freebsd.org> Subject: Re: apache.sh PREFIX problem Message-ID: <001a01c1510a$52158770$0100a8c0@thunderbird> References: <000801c15101$138dc5c0$0100a8c0@thunderbird> <bqwCp1AAF2w7EwU2@caomhin.demon.co.uk>
next in thread | previous in thread | raw e-mail | index | archive | help
I couldnt figure out all that case stuff so I made my own script
I tried to run the commented out version you sent but I was still getting
and error below is what i came up with
what do you think?
laptop# cat apache.sh
#!/bin/sh
if [ -x /usr/local/sbin/apachectl ]
then /usr/local/sbin/apachectl start > /dev/null && echo -n ' apache'
fi
if [ -r /var/run/httpd.pid ]
then /usr/local/sbin/apachectl stop > /dev/null && echo -n ' apache'
fi
laptop#
----- Original Message -----
From: "Kevin Golding" <kevin@caomhin.demon.co.uk>
To: "george" <george@vagner.com>
Sent: Tuesday, October 09, 2001 1:42 PM
Subject: Re: apache.sh PREFIX problem
> In message <000801c15101$138dc5c0$0100a8c0@thunderbird>, george
> <george@vagner.com> writes
> > I can start apache manually but my installled apache.sh wont start
> > it
> > it pukes on
> >
> > laptop# ./apache.sh
> > ./apache.sh: Cannot determine the PREFIX
> > laptop#
> >
> >
> > here is the apache.sh file that was installed using the ports.
> > I suspect its something in that "\(/.*\)/etc mess but i am not a
> > scripter and
> > have no idea what to put in there or take out for that matter...
>
> A script guru will probably suggest something better but this will work:
>
>
> #!/bin/sh
>
> #if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
> # echo "$0: Cannot determine the PREFIX" >&2
> # exit 1
> # fi
>
> case "$1" in
> start)
> [ -x usr/local/sbin/apachectl ] && /usr/local/sbin/apachectl
> start > /dev
> /null && echo -n ' apache'
> ;;
> stop)
> [ -r /var/run/httpd.pid ] && /usr/local/sbin/apachectl stop
> > /dev/null &
> & echo -n ' apache'
> ;;
> *)
> echo "Usage: `basename $0` {start|stop}" >&2
> ;;
> esac
>
> exit 0
>
>
> Basically your prefix is most likely /usr/local if you installed from
> ports, if you're starting manually you know this :-) I think the PREFIX
> stuff should've been sorted out on install.
>
> Kevin
> --
> kevin@caomhin.demon.co.uk
>
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?001a01c1510a$52158770$0100a8c0>
