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:
855 bytes
|
Line | |
---|
1 | #!/bin/sh
|
---|
2 |
|
---|
3 | PATH=$PATH:/bin:/usr/bin
|
---|
4 | export PATH
|
---|
5 |
|
---|
6 | # HTTP proxy to use
|
---|
7 | HTTP_PROXY=http://proxy.wleiden.net:3128
|
---|
8 |
|
---|
9 | # Test page to query
|
---|
10 | PROXY_TEST=http://proxy-test.wirelessleiden.nl/
|
---|
11 |
|
---|
12 | # Make variable global, so fetch can use it
|
---|
13 | export HTTP_PROXY
|
---|
14 |
|
---|
15 | # Query the webpage
|
---|
16 | SPEEDOUT=`fetch -o /dev/null ${PROXY_TEST} 2>&1`
|
---|
17 |
|
---|
18 | # What is the Exit code of fetch?
|
---|
19 | SPEEDEXIT=$?
|
---|
20 |
|
---|
21 | # The speed by which the webpages was retrieved"
|
---|
22 | SPEED=`echo ${SPEEDOUT} | awk '{ print $4 " " $5 }'`
|
---|
23 |
|
---|
24 | # What was the format of speed (Bps)
|
---|
25 | TYPE=`echo ${SPEEDOUT} | awk '{ print $5 }'`
|
---|
26 |
|
---|
27 | # Dit the fetcommand exit happy, and was the format as we expected
|
---|
28 | if [ ${SPEEDEXIT} -eq 0 -a "$TYPE" = "Bps" ]; then
|
---|
29 |
|
---|
30 | # Let's celebrate, it was successfull
|
---|
31 | echo "INET OK: $SPEED"
|
---|
32 | exit 0
|
---|
33 | else
|
---|
34 |
|
---|
35 | # Oh no, time to get drunk, retrieval was unsuccessfull
|
---|
36 | echo "INET CRITICAL: $SPEEDOUT\n"
|
---|
37 | exit 2
|
---|
38 |
|
---|
39 | fi
|
---|
40 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.