Last change
on this file was 14358, checked in by rick, 6 years ago |
Fix documentation files no longer installed
|
-
Property svn:executable
set to
*
|
File size:
652 bytes
|
Line | |
---|
1 | #!/bin/sh
|
---|
2 |
|
---|
3 | PATH=$PATH:/bin:/usr/bin
|
---|
4 | export PATH
|
---|
5 |
|
---|
6 | # Test page to query
|
---|
7 | PROXY_TEST=http://proxy-test.wirelessleiden.nl/
|
---|
8 |
|
---|
9 | # Query the webpage
|
---|
10 | SPEEDOUT=`fetch -o /dev/null ${PROXY_TEST} 2>&1`
|
---|
11 |
|
---|
12 | # What is the Exit code of fetch?
|
---|
13 | SPEEDEXIT=$?
|
---|
14 |
|
---|
15 | # The speed by which the webpages was retrieved"
|
---|
16 | SPEED=`echo ${SPEEDOUT} | awk '/Bps/ { print $13 " " $14 }'`
|
---|
17 |
|
---|
18 | # Dit the fetcommand exit happy, and was the format as we expected
|
---|
19 | if [ ${SPEEDEXIT} -eq 0 -a "$SPEED" ]; then
|
---|
20 |
|
---|
21 | # Let's celebrate, it was successfull
|
---|
22 | printf "INET OK: $SPEED\n"
|
---|
23 | exit 0
|
---|
24 | else
|
---|
25 |
|
---|
26 | # Oh no, time to get drunk, retrieval was unsuccessfull
|
---|
27 | echo "INET CRITICAL: $SPEEDOUT\n"
|
---|
28 | exit 2
|
---|
29 |
|
---|
30 | fi
|
---|
31 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.