From owner-freebsd-questions Tue Oct 9 14:35:45 2001 Delivered-To: freebsd-questions@freebsd.org Received: from ns1.vagner.com (NS1.VAGNER.COM [204.120.36.11]) by hub.freebsd.org (Postfix) with ESMTP id 3D3D137B405 for ; Tue, 9 Oct 2001 14:35:37 -0700 (PDT) Received: (from root@localhost) by ns1.vagner.com (8.11.2/8.11.6) id f99LZRZ99491; Tue, 9 Oct 2001 14:35:27 -0700 (MST) (envelope-from george@vagner.com) Received: from thunderbird (vsat-148-71-111-158.ssa4.mcl.starband.net [148.71.111.158]) by ns1.vagner.com (8.11.2/8.11.6av) with SMTP id f99LZIC99483; Tue, 9 Oct 2001 14:35:19 -0700 (MST) (envelope-from george@vagner.com) Message-ID: <001a01c1510a$52158770$0100a8c0@thunderbird> From: "george" To: "Kevin Golding" Cc: References: <000801c15101$138dc5c0$0100a8c0@thunderbird> Subject: Re: apache.sh PREFIX problem Date: Tue, 9 Oct 2001 14:35:14 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Virus-Scanned: by AMaViS perl-10 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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" To: "george" Sent: Tuesday, October 09, 2001 1:42 PM Subject: Re: apache.sh PREFIX problem > In message <000801c15101$138dc5c0$0100a8c0@thunderbird>, george > 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