File: RunAccel.in

package info (click to toggle)
squid3 3.0.PRE5-5%2Betch2
  • links: PTS
  • area: main
  • in suites: etch
  • size: 21,188 kB
  • ctags: 20,388
  • sloc: cpp: 119,851; ansic: 30,259; sh: 10,465; makefile: 3,289; perl: 1,267; awk: 84; xml: 58
file content (36 lines) | stat: -rw-r--r-- 725 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
#
#  $Id: RunAccel.in,v 1.7 2003/01/23 00:37:06 robertc Exp $

# enable HTTP requests on port 80
port="-a 80"

prefix=@prefix@
exec_prefix=@exec_prefix@
logdir=@localstatedir@
PATH=@sbindir@:/bin:/usr/bin
export PATH

if test $# = 1 ; then
	conf="-f $1"
	shift
fi

failcount=0
while : ; do
	echo "Running: squid $port -s $conf >> $logdir/squid.out 2>&1"
	start=`date '+%d%H%M%S'`
	squid -N $port -s $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