#!/bin/bash # a simple script to check if a site has changed # utilizes curl and sha1sum, so I guess these would be the dependiences # information in the format [HH:MM:SS] has changed # is currently output to stdout, expect improvements here # there is also minimal error checking, so it'll probably get fucked up # with some exotic URLs or protocols or whatever # XAVeRY 2009, public domain lol if [ $# -ne 4 ] || [ $1 != "-u" ] || [ $3 != "-p" ]; then echo "Usage : $0 -u -p " exit fi newsum="" oldsum="" while [ TRUE ] ; do curl -s -o .tmpfile $2 if [ $? -ne 0 ]; then echo 'curl execution returned an error, killing script...' exit fi nowasuma=`sha1sum .tmpfile | cut -b -40` if [ $nowasuma != $starasuma ]; then echo "[`date +%T`] $2 has changed!" fi starasuma=$nowasuma sleep $4 done