Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- lock_file='itLives.lock'
- if [ -e $lock_file ]
- then
- modtime=`stat -c %Y itLives.lock`
- nowtime=`date +%s`
- modtime=$((modtime+0))
- nowtime=$((nowtime-900))
- if [ $nowtime -gt $modtime ]
- then
- rm -f $lock_file
- else
- # echo $lock_file
- exit 1;
- fi
- fi
- touch $lock_file
- all="ALL:ok"
- results=""
- while read -r line; do
- for test in `ls tests`
- do
- result=`tests/$test $pages`
- if [ "$result" != "ok" ]
- then
- all=""
- if [ "$results" != "" ]
- then
- results=$results", "
- fi
- results=$results$test":"$result
- fi
- done
- result=$all$results
- lastResult=`cat lastResult.log 2> /dev/null`
- #if [ "$lastResult" != "$result" ]
- #then
- #for notifications in `ls notifications`
- #do
- # notifications/$notifications "`date +%H:%M:%S`@`hostname`: $result"
- #done
- echo $result > lastResult.log
- echo "`date` - $result" >> results.log
- #fi
- done < "pages.txt"
- rm -f $lock_file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement