#!/usr/bin/sh #---------------------------------------------------------------------------- # /var/install/bin/quota-grp-report - show group 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. #---------------------------------------------------------------------------- grpswitchfile=/var/lib/quota/quota_grp_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 ${grpswitchfile} ] then for mountpoint in $(cat ${grpswitchfile} | cut -d: -f1) do dev=$(grep -E "[[:space:]]+${mountpoint}[[:space:]]+" /etc/fstab | sed -e 's/[[:space:]]\+/ /g' | cut -d\ -f1) dev_type=$(grep "${mountpoint}:" ${grpswitchfile} | cut -d: -f2) if [ "${dev_type}" = "vfsv0" ] then for i in $(LANG=C; quotaon -agp | grep ${mountpoint} | grep 'group quota' | grep 'is on' | cut -d\( -f2 | cut -d\) -f1) do /usr/sbin/repquota -gs ${i} >>/run/quota-grp-report done elif [ "${dev_type}" = "xfs" ] then /usr/sbin/repquota -gs ${mountpoint} >>/run/quota-grp-report fi done clrhome if [ -f /run/quota-grp-report ] then ${SHOW_DOC} ${color} ${frame} --follow --title 'Quota grp report' \ /run/quota-grp-report else mecho --info "No group disk quotas defined." anykey fi fi rm -f /run/quota-grp-report