#!/bin/sh # Title : Quotatab v1.0 # Creator : Stefanos P. # Nickname : kRocKodile # Email : krockodile@gmail.com # Date : 14-07-2006 # # Installation: # 1. Copy this script to /usr/sbin # 2. Make it executable with this command: chmod +x /usr/sbin/quotatab # 3. Create the config file /etc/quotatab.conf # # Now every time you run quotatab you apply the changes you made in config file # # Config file example: # maria 800000 1000000 0 0 /home/maria # chritina 500000 500000 0 0 /mnt/md0 # john 3000000 32000000 0 0 -a # # If you dont want the default config in /etc/ you can specify # another config file as an argument # example: quotatab /mnt/backup/quotatab.conf ARGS=$# if [ $ARGS -gt "1" ] then /bin/echo -e "Parameters more than one ($ARGS). Aborting..." ; exit fi config="$1" if [ ! -f $1 ] then echo -e "This file does not exists ($1). Aborting..." ; exit fi if [ ! -f /etc/backup/quotatab.conf ] then echo -e "Can't found /etc/quotatab.conf. Aborting..." ; exit fi IFS=$'\n' for line in `/bin/cat /etc/quotatab.conf` do IFS=$'" "\t\n' host=`echo $line | awk '{print $1}'` /usr/sbin/setquota $line /usr/sbin/repquota -as | grep $host done