#!/bin/sh

PATH=/bin:/usr/bin:/sbin:/usr/sbin
export PATH

[ -x /usr/bin/innetgr ] || exit 0

for hostname in "$(uname -n)" "$(hostname -s)" ; do

    # Automatically extend full LVM volumes if the host is a member of
    # the fsautoresize-hosts netgroup.
    if [ -x /usr/sbin/debian-edu-fsautoresize ] &&
	innetgr -h $hostname fsautoresize-hosts ; then
        debian-edu-fsautoresize -n
    fi

    # Automatically restart disabled print queues every hour if the
    # host is a member of the cups-queue-autoreenable-hosts netgroup.
    if [ -x /usr/share/debian-edu-config/tools/cups-queue-autoreenable ] &&
	innetgr -h $hostname cups-queue-autoreenable-hosts ; then
	/usr/share/debian-edu-config/tools/cups-queue-autoreenable
    fi
done
