#!/bin/sh #---------------------------------------------------------------------------- # /var/install/bin/quota-usr-report - show user quotas # # Creation: 01.01.2004 jb # Last Update: $Id$ # # Copyright (c) 2004-2008 Jens Berger # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #---------------------------------------------------------------------------- usrswitchfile=/var/quota/quota_usr_switch # reading eislib . /var/install/include/eislib #exec 2> /tmp/quota-usr-report-$$.log #set -x if [ -f $usrswitchfile ]; then for mountpoint in `cat $usrswitchfile | cut -d: -f1`; do dev=`grep -E "[[:space:]]+$mountpoint[[:space:]]+" /etc/fstab | sed -e 's/[[:space:]]\+/ /g' | cut -d\ -f1` dev_type=`grep "$mountpoint:" $usrswitchfile | cut -d: -f2` if [ "$dev_type" = "vfsv0" ]; then for i in `quotaon -aup | grep $mountpoint | grep 'user quota' | grep 'is on' | cut -d\( -f2 | cut -d\) -f1`; do /usr/sbin/repquota -us $i >>/tmp/quota-usr-report done elif [ "$dev_type" = "xfs" ]; then /usr/sbin/repquota -us $mountpoint >>/tmp/quota-usr-report fi done clrhome if [ -f /tmp/quota-usr-report ]; then more /tmp/quota-usr-report else mecho -info "No user disk quotas defined." fi fi anykey rm -f /tmp/quota-usr-report