cdist/cdist/conf/type/__package_apt/explorer/index

10 lines
277 B
Bash

#!/bin/sh -e
if [ ! -d /var/lib/apt/lists ] \
|| [ -n "$( find /etc/apt -newer /var/lib/apt/lists )" ] \
|| [ ! -f /var/cache/apt/pkgcache.bin ] \
|| [ "$( stat --format %Y /var/cache/apt/pkgcache.bin )" -lt "$( date +%s -d '-1 day' )" ]
then
echo 'update'
fi