diff options
| author | Michael Christen <mc@yacy.net> | 2012-01-02 02:09:49 +0100 |
|---|---|---|
| committer | Michael Christen <mc@yacy.net> | 2012-01-02 02:09:49 +0100 |
| commit | 7a5ff9b8088c0a5e34c5969c0e4e51454581b2ae (patch) | |
| tree | 30061db853c5695b9d10db6c83ce017a56f96002 /bin | |
| parent | ce289eb64f18a6ba6e82290e369b7e06121fb053 (diff) | |
added checkalive script that can be called frequently to restart crashed
peers automatically
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/checkalive.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/bin/checkalive.sh b/bin/checkalive.sh new file mode 100755 index 000000000..870ac4e7a --- /dev/null +++ b/bin/checkalive.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# add in /etc/crontab +# 0 * * * * yacy cd /home/yacy/production/bin && ./checkalive.sh + +RESULT=`wget --spider http://localhost:8090/Status.html 2>&1` +FLAG=0 + +for x in $RESULT; do + if [ "$x" = '200' ]; then + FLAG=1 + fi +done + +if [ $FLAG -eq '0' ]; then + cd .. + timeout 30s ./stopYACY.sh + ./killYACY.sh + rm DATA/yacy.running + ./startYACY.sh +fi + +exit |
