Line | |
---|
1 | #!/bin/sh
|
---|
2 |
|
---|
3 | PROXY=proxy.wleiden.net:3128
|
---|
4 | URL=http://proxy-test.wirelessleiden.nl
|
---|
5 | FILE=/tmp/proxy-test.wirelessleiden.nl
|
---|
6 |
|
---|
7 | # Set proxy to escape the network
|
---|
8 | export HTTP_PROXY=${PROXY}
|
---|
9 |
|
---|
10 | # Fetch the website (curl not installed)
|
---|
11 | fetch -o ${FILE} ${URL} 2> /dev/null
|
---|
12 | if [ -w ${FILE} ]; then
|
---|
13 | retval=`cat ${FILE}`
|
---|
14 | rm ${FILE}
|
---|
15 | fi
|
---|
16 |
|
---|
17 | # Chech if website returns the expected result
|
---|
18 | if [ "$retval" = "1" ]; then
|
---|
19 | echo "WWW OK: Got a www website"
|
---|
20 | exit 0
|
---|
21 | else
|
---|
22 | echo "WWW CRITICAL: Unable to fetch www website"
|
---|
23 | exit 2
|
---|
24 | fi
|
---|
25 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.