diff options
-rw-r--r-- | Changelog | 1 | ||||
-rwxr-xr-x | quota-nfs.sh | 28 |
2 files changed, 29 insertions, 0 deletions
@@ -1,4 +1,5 @@ Changes in quota-tools from 3.17 to 4.00-pre2 +* create quota-nfs.sh script for nicer quota(1) output formatting on some NFS clients (Jan Kara) * add options for quota(1) modifying formatting of filesystem identificaion (Jan Kara) * minor updates of manpages (Jan Kara) * quotactl manpage was moved to man-pages package (Jan Kara) diff --git a/quota-nfs.sh b/quota-nfs.sh new file mode 100755 index 0000000..de4334e --- /dev/null +++ b/quota-nfs.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +# This is a script which generates more user friendly output of quota(1) +# command for systems with NFS-mounted home directories. +# +# In the simplest case it is enough to edit BASEDIR to point to a directory +# under which home directories are mounted. In more complicated cases, +# updating the shell matching code should be simple enough. +# +# Note that you can use also device name (NFS export in case of NFS mount +# point) for your matching. + +BASEDIR="/home" + +DIRS=`quota -A -Q -v --show-mntpoint --no-wrap | +sed -n -e '3,$p' | +cut -d ' ' -f 1,2 | +while read DEVICE DIR; do + case $DIR in + $BASEDIR/$LOGNAME) echo -n "$DIR " ;; + $BASEDIR/*) ;; + *) echo -n "$DIR " ;; + esac +done` + +if [ -n "$DIRS" ]; then + quota $@ -f $DIRS +fi |