From owner-freebsd-questions Mon Dec 16 3:17:37 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2E23C37B401 for ; Mon, 16 Dec 2002 03:17:36 -0800 (PST) Received: from post-21.mail.nl.demon.net (post-21.mail.nl.demon.net [194.159.73.20]) by mx1.FreeBSD.org (Postfix) with ESMTP id C36B643EA9 for ; Mon, 16 Dec 2002 03:17:34 -0800 (PST) (envelope-from cls@raggedclown.net) Received: from [212.238.197.102] (helo=mailhost.raggedclown.net) by post-21.mail.nl.demon.net with esmtp (Exim 3.36 #1) id 18NtFc-000Hfq-00 for questions@freebsd.org; Mon, 16 Dec 2002 11:17:32 +0000 Received: from localhost (localhost [127.0.0.1]) by mailhost.raggedclown.net (Ragged Clown Mail Gateway [dawn]) with ESMTP id B0C29F09 for ; Mon, 16 Dec 2002 12:17:31 +0100 (CET) Received: from willow.raggedclown.net (willow.raggedclown.intra [192.168.1.10]) by mailhost.raggedclown.net (Ragged Clown Mail Gateway [dawn]) with ESMTP id 9ACD3C0C for ; Mon, 16 Dec 2002 12:17:19 +0100 (CET) Received: by willow.raggedclown.net (Ragged Clown Host [willow], from userid 1009) id C002C225D9; Mon, 16 Dec 2002 12:17:19 +0100 (CET) Date: Mon, 16 Dec 2002 12:17:19 +0100 From: Cliff Sarginson To: FreeBSD Questions Mail List Subject: Re: Broken Startup Script Message-ID: <20021216111719.GA1752@raggedclown.net> References: <1040035528.444.5.camel@enigma.8ball.co.za> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1040035528.444.5.camel@enigma.8ball.co.za> User-Agent: Mutt/1.5.1i X-Virus-Scanned: by AMaViS 0.3.12pre8 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 On Mon, Dec 16, 2002 at 12:45:28PM +0200, Nelis Lamprecht wrote: > Hi People, > > Since upgrading to latest stable a few of my startup scripts have > stopped working due to the changes in sh. I have fixed most but not sure > how to fix the below script which keeps giving me [: > /usr/local/sbin/snmpd: unexpected operator > > Many Thanks, > Nelis > > #!/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) I would guess, if you have accurately pasted this the next two lines should be 1 line ... a " \" to the end of the first one (space backslash, nothing after the backslash). > [ -x ${PREFIX}/sbin/snmpd -c ${PREFIX}/share/snmp/snmpd.conf ] && > ${PREFIX}/sbin/snmpd && echo -n ' snmpd' > ;; > stop) > killall snmpd && echo -n ' snmpd' > ;; > *) > echo "Usage: `basename $0` {start|stop}" >&2 > ;; > esac > > exit 0 > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message -- Regards Cliff Sarginson The Netherlands [ This mail has been checked as virus-free ] To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message