#!/bin/bash # # (c) 2006 Pawel Maziarz , te sprawy.. TIMEOUT=60 tmpdir=tmp tmpname="tmpischange-`date +'%Y%m%d%H%M%S'`" mailcmd="mutt -x" mailto="drg@secprog.org" usage() { echo "usage: $0 [timeout]" exit 0 } if [ ! $1 ]; then usage else url="$1" fi if [ $2 ]; then timeout=$2 else timeout=$TIMEOUT fi if [ $timeout -lt 1 ]; then timeout=$TIMEOUT fi echo $url echo $timeout file1=$tmpdir/$tmpname-orig file2=$tmpdir/$tmpname wget "$url" -O $file1 >/dev/null 2>&1 while [ 1 ]; do wget "$url" -O $file2 >/dev/null 2>&1 || continue change=`diff $file1 $file2 2>/dev/null` || break sleep $timeout done echo $change | $mailcmd -s "change $url" $mailto