Author: jw Date: 2006-06-02 19:10:17 +0200 (Fri, 02 Jun 2006) New Revision: 1483 Modified: tools/scripts/check_urls Log: check_urls: small fixes, set time deltas Modified: tools/scripts/check_urls =================================================================== --- tools/scripts/check_urls 2006-06-02 15:58:05 UTC (rev 1482) +++ tools/scripts/check_urls 2006-06-02 17:10:17 UTC (rev 1483) @@ -10,16 +10,22 @@ HTMLLOG=$STATE_DIR/state.html PORT_STATES=$STATE_DIR/ports/ -NOTIFY_DELTA=10 # seconds -REMOVE_DELTA=20 +FROM=crux@crux.nu +TO=jw@localhost +NOTIFY_DELTA=604800 # 7 days +REMOVE_DELTA=172800 # 2 days + notify() { local port=$1 local url=$2 local cause=$3 local state=$4 - echo "==> Notify: $port, Url: $url Reason: $2, State: $3" + echo -e "Port: $port\n" \ + "Url: $url\n" \ + "Reason: $3\n" \ + "State: $state\n" } log() { @@ -54,11 +60,11 @@ # debug "Delta: $delta" if [ ! "$(cat $PORT_STATES/$port.cause)" = "$cause" ]; then - notify "$portpath" "$cause" "Changed reason" + notify "$portpath" $url "$cause" "Changed reason" echo $now > $PORT_STATES/$port.notified echo $cause > $PORT_STATES/$port.cause elif [ $delta -gt $NOTIFY_DELTA ]; then - notify "$portpath" "$cause" "Reminder" + notify "$portpath" $url "$cause" "Reminder" echo $now > $PORT_STATES/$port.notified fi @@ -66,7 +72,7 @@ else datestr=$(date +%s) - notify "$portpath" "$cause" "New" + notify "$portpath" $url "$cause" "New" log $datestr $portpath "$cause" "NEW" echo $datestr > $PORT_STATES/$port.created @@ -139,6 +145,7 @@ echo "</body></html>" >> $HTMLLOG } + ########## @@ -152,4 +159,3 @@ cleanup_states htmlify -
participants (1)
-
crux@crux.nu