fix dpkg so it really shows ALL installed packages

git-svn-id: http://www.observium.org/svn/observer/trunk@3132 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2012-05-03 16:33:28 +00:00
parent 5084bae215
commit 7bed89ebbc

View File

@@ -7,12 +7,12 @@ if [ -x /usr/bin/dpkg-query ]; then
FILE=/tmp/observium-agent-dpkg
if [ ! -e $FILE ]; then
dpkg-query -W --showformat='${Status} ${Package} ${Version} ${Architecture} ${Installed-Size}\n'|grep "^install"|cut -d\ -f4- > $FILE
dpkg-query -W --showformat='${Status} ${Package} ${Version} ${Architecture} ${Installed-Size}\n'|grep " installed "|cut -d\ -f4- > $FILE
fi
FILEMTIME=$(stat -c %Y $FILE)
FILEAGE=$(($DATE-$FILEMTIME))
if [ $FILEAGE -gt 1800 ]; then
dpkg-query -W --showformat='${Status} ${Package} ${Version} ${Architecture} ${Installed-Size}\n'|grep "^install"|cut -d\ -f4- > $FILE
dpkg-query -W --showformat='${Status} ${Package} ${Version} ${Architecture} ${Installed-Size}\n'|grep " installed "|cut -d\ -f4- > $FILE
fi
echo "<<<dpkg>>>"
cat $FILE