1
0
mirror of https://github.com/librenms/librenms-agent.git synced 2024-05-09 09:54:52 +00:00

fix(dpkg): No such file or directory (#400)

This commit is contained in:
Shao Yu-Lung (Allen)
2022-05-20 06:22:32 +08:00
committed by GitHub
parent c12f320273
commit ed00d088c5

View File

@ -6,6 +6,8 @@ if [ -x /usr/bin/dpkg-query ]; then
DATE=$(date +%s)
FILE=/var/cache/librenms/agent-local-dpkg
[ -d /var/cache/librenms ] || mkdir -p /var/cache/librenms
if [ ! -e $FILE ]; then
dpkg-query -W --showformat='${Status} ${Package} ${Version} ${Architecture} ${Installed-Size}\n'|grep " installed "|cut -d\ -f4- > $FILE
fi