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

16 lines
311 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
;;
*) ## not supported $os
;;
esac