File: RunAccel.in

package info (click to toggle)
squid 2.4.6-2woody8
  • links: PTS
  • area: main
  • in suites: woody
  • size: 8,724 kB
  • ctags: 9,570
  • sloc: ansic: 75,398; sh: 2,213; makefile: 1,839; perl: 1,099; awk: 35
file content (36 lines) | stat: -rw-r--r-- 724 bytes parent folder | download | duplicates (2)
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.5 1999/01/29 18:19:45 wessels Exp $

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

prefix=@prefix@
exec_prefix=@exec_prefix@
logdir=@localstatedir@
PATH=@bindir@:/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