RunCache.in
上传用户:liugui
上传日期:2007-01-04
资源大小:822k
文件大小:1k
- #!/bin/sh
- #
- # $Id: RunCache.in,v 1.9 1999/01/29 18:19:46 wessels Exp $
- prefix=@prefix@
- exec_prefix=@exec_prefix@
- logdir=@localstatedir@
- PATH=@bindir@:/bin:/usr/bin
- export PATH
- conf=""
- if test "$1" ; then
- conf="-f $1"
- shift
- fi
- failcount=0
- while : ; do
- echo "Running: squid -sY $conf >> $logdir/squid.out 2>&1"
- echo "Startup: `date`" >> $logdir/squid.out
- start=`date '+%d%H%M%S'`
- squid -NsY $conf >> $logdir/squid.out 2>&1
- stop=`date '+%d%H%M%S'`
- t=`expr $stop - $start`
- if test 0 -le $t -a $t -lt 5 ; then
- failcount=`expr $failcount + 1`
- else
- failcount=0
- fi
- if test $failcount -gt 5 ; then
- echo "RunCache: EXITING DUE TO REPEATED, FREQUENT FAILURES" >&2
- exit 1
- fi
- sleep 10
- done