From owner-freebsd-questions Tue Dec 17 4:12:42 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 87F8737B401 for ; Tue, 17 Dec 2002 04:12:40 -0800 (PST) Received: from smtp.melim.com.br (aririba.melim.com.br [200.215.110.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4696143EDE for ; Tue, 17 Dec 2002 04:12:39 -0800 (PST) (envelope-from ronan@melim.com.br) Received: from fazendinha (ressacada.melim.com.br [200.215.110.4]) by smtp.melim.com.br (Postfix) with SMTP id 483FEFD01; Tue, 17 Dec 2002 10:11:02 -0200 (EDT) Message-ID: <010f01c2a5c5$ad589800$34a8a8c0@melim.com.br> From: "Ronan Lucio" To: "Bob Hall" , "FreeBSD Questions List" References: <20021217010954.GA49241@sten.alder.net> Subject: Re: squid.sh problem Date: Tue, 17 Dec 2002 10:13:15 -0200 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.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 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 Bob, It seems you added the -D option in the wrong place. The bellow squid.sh works for me in a charm: ------------------------------ #!/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) if [ -x ${PREFIX}/sbin/squid -a -f ${PREFIX}/etc/squid/squid.conf ]; then (cd /${PREFIX}/squid/logs; ${PREFIX}/sbin/squid -D >/dev/null 2>&1 &) ; echo -n ' squid' fi ;; stop) ${PREFIX}/sbin/squid -k shutdown 2>&1 # Uncomment this if you'd like the system to (attempt to # wait for) squid to shut down cleanly #echo "Sleeping for 45 seconds to allow squid to shutdown.." #sleep 45 ;; *) echo "Usage: `basename $0` {start|stop}" >&2 ;; esac exit 0 ------------------------------ Ronan > When my FBSD 4.4 host starts, it runs squid.sh, which returns > the following error: > [: -D: unexpected operator > The the machine is booted, it is not connected to the Internet, > so I need the -D option. When I start squid manually, it happily > accepts the -D option. This bash script has run in the past with > the -D option without any problems. This problem started a few > days ago. The machine is booted at least once a day, so I'd like > to have the bash script working properly again. Does anyone know > what's causing this, or how to fix it? > > Bob Hall > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message