#!/bin/bash # # Plugin to monitor the number of orphaned packages on the # system (using deborphan). Might work on section distib, who knows... # # Based on the debsecan plugin by Nicolas Bouthors. 2016-09-02 # # Olivie Mehani # # Licence : GPLv2 # #%# family=auto #%# capabilities=autoconf # Auto enable if we have deborphan only if [ "$1" = "autoconf" ] ; then if [ -x /usr/bin/deborphan ]; then echo yes else echo no fi exit 0 fi # Fail if we don't have deborphan if [ ! -x /usr/bin/deborphan ]; then exit 1 fi OUT=`mktemp -t deborphan.XXXXXX` deborphan --show-section --guess-all | sed 's/\//_/' | sort > ${OUT} CATEGORIES="$(sed 's/ .*//' ${OUT} | uniq)" if [ "$1" = "config" ]; then cat < ${TMP} echo "${cat}.value `cat ${TMP} | wc -l`" echo "${cat}.extinfo `echo $(cat ${TMP})`" rm ${TMP} done fi rm -f ${OUT}