Date: Tue, 17 Dec 2002 10:13:15 -0200 From: "Ronan Lucio" <ronan@melim.com.br> To: "Bob Hall" <rjhalljr@starpower.net>, "FreeBSD Questions List" <freebsd-questions@freebsd.org> Subject: Re: squid.sh problem Message-ID: <010f01c2a5c5$ad589800$34a8a8c0@melim.com.br> References: <20021217010954.GA49241@sten.alder.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?010f01c2a5c5$ad589800$34a8a8c0>