#!/usr/bin/sh #---------------------------------------------------------------------------- # /var/install/bin/quota-usr-report - show user quotas # # Creation: 2004-01-01 jb # Last Update: $Id$ # # Copyright (c) 2004-2008 Jens Berger, jberger(at)gmx(dot)net # Copyright (c) 2012-@@YEAR@@ Holger Bruenjes, holgerbruenjes(at)gmx(dot)net # # 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/lib/quota/quota_usr_switch SHOW_DOC=/var/install/bin/show-doc.cui color='' frame='' if $(grep -qE "^MENU=['\"]/var/install/bin/show-menu['\"]" /etc/config.d/setup) then color='--nocolor' frame='--noframe' fi # reading eislib . /var/install/include/eislib 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 $(LANG=C; quotaon -aup | grep ${mountpoint} | grep 'user quota' | grep 'is on' | cut -d\( -f2 | cut -d\) -f1) do /usr/sbin/repquota -us ${i} >>/run/quota-usr-report done elif [ "${dev_type}" = "xfs" ] then /usr/sbin/repquota -us ${mountpoint} >>/run/quota-usr-report fi done clrhome if [ -f /run/quota-usr-report ] then ${SHOW_DOC} ${color} ${frame} --follow --title 'Quota usr report' \ /run/quota-usr-report else mecho --info "No user disk quotas defined." anykey fi fi rm -f /run/quota-usr-report