cdist/cdist/conf/type/__package_update_index/explorer/currage

18 lines
483 B
Bash

#!/bin/sh -e
os="$("$__explorer/os")"
case "$os" in
debian|ubuntu|devuan)
if [ -f "/var/cache/apt/pkgcache.bin" ]; then
echo $(($(date +"%s")-$(stat --format '%Y' /var/cache/apt/pkgcache.bin)))
else
echo 0
fi
;;
*) echo "Your operating system ($os) is currently not supported by this type (${__type##*/})." >&2
echo "Please contribute an implementation for it if you can." >&2
exit 1
;;
esac