#!/bin/sh SYSTEMS="unstable" for system in $SYSTEMS do DUMP_DIR=/home/hendry/debian.dabase.com/$system/ DATA=$DUMP_DIR/data NOW=$DUMP_DIR/now NAME=`date -u --iso-8601=hours` ldapsearch -x -h bts2ldap.debian.net -p 10101 -b dc=current,dc=bugs,dc=debian,dc=org \ "(&(debbugsSeverity=critical) (debbugsAffected=$system))" > $DUMP_DIR/$NAME rm $NOW ln -s $DUMP_DIR$NAME $NOW #First we grab the lines we are interested in from the LDAP output egrep '^debbugsID|^debbugsDate|^debbugsPackage|^debbugsTitle' $NOW | # Arrange stuff on one line (hairy, as if things are the wrong order this will break) sed 'N;N;N;s/^debbugsID: \(.*\)\ndebbugsDate: \(.*\)\ndebbugsPackage: \(.*\)\ndebbugsTitle:\(.*\)/\2 \1 \3 \4/g;p;d' | # Sort epoch time reverse sort -r -n -k 1 | # Put the date into iso-8601 format and write at as a CSV type text file while read date bugno; do date=$(date --iso-8601 -d "1 jan 1970 + $date seconds"); printf "%s %s\n" "$date" "$bugno"; done > $DATA.txt count=0 cat $DATA.txt | # Parse each line and write it as a table row in HTML with a link to the BTS while read date bugno package extra; do \ count=`expr $count + 1`; \ printf "