#!/bin/bash
#
# test_updates
#
# fehlende Patche des Servers ans ULS
#
if [[ $# -lt 2 ]]
 then
  DT=`date '+%F %T%:z'`
else
  DT="$1 $2"
fi
#
# list updates
#
#
#
PD=$(ls -gGt --time-style='+%F %T' /var/lib/dpkg/info | fgrep -v total | head -1 | sed -n 's/.......... [0-9][0-9]* *[0-9][0-9]* *\([0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]\).*/\1/p')
if [[ -n "$PD" ]]
 then
  send_test_value System Info 'Last Software Install' $DT "$PD" '{DT}'
fi
