From owner-freebsd-questions Mon Dec 16 2:44:19 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 5B32B37B401 for ; Mon, 16 Dec 2002 02:44:18 -0800 (PST) Received: from brabys.co.za (postoffice.brabys.co.za [192.96.48.13]) by mx1.FreeBSD.org (Postfix) with ESMTP id 404EC43ED1 for ; Mon, 16 Dec 2002 02:44:15 -0800 (PST) (envelope-from nelis@brabys.co.za) Received: from [192.96.48.37] (proxy-inner.brabys.co.za [192.96.48.11]) by brabys.co.za (8.12.0/8.12.0) with ESMTP id gBGAh0qI013099 for ; Mon, 16 Dec 2002 12:43:00 +0200 Subject: Broken Startup Script From: Nelis Lamprecht Reply-To: nelis@brabys.co.za To: FreeBSD Questions Mail List Content-Type: text/plain Organization: Message-Id: <1040035528.444.5.camel@enigma.8ball.co.za> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.0 Date: 16 Dec 2002 12:45:28 +0200 Content-Transfer-Encoding: 7bit X-MailScanner: Found to be clean 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 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) [ -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