Skip to content

Commit

Permalink
add site_alive_check.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhiqiang Ma committed May 26, 2010
1 parent 4496212 commit 456dddc
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions data/linux/config/site_alive_check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

localdir=/tmp/pkill.info
testurl=http://pkill.info/blog/
testfile=index.html

testfileaddr=${localdir}/${testfile}
mkdir -p $localdir
rm -f ${localdir}/${testfile}

wget --tries=3 --timeout=10 ${testurl} -O ${testfileaddr}

if [[ -f ${testfileaddr} ]]
then
date;
echo "ok";
else
date | mailx -S smtp="smtp://smtp.ust.hk" -s "pkill.info test failed." -r "admin@pkill.info" eric@pkill.info
fi

0 comments on commit 456dddc

Please sign in to comment.