All pastes #87975 Raw Edit

Mine

public shellscript v1 · immutable
·published 2006-07-14 10:53 UTC
rendered paste body
#!/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.confARGS=$#if [ $ARGS -gt "1" ]then /bin/echo -e "Parameters more than one ($ARGS). Aborting..." ; exitficonfig="$1"if [ ! -f $1 ]then echo -e "This file does not exists ($1). Aborting..." ; exitfiif [ !  -f  /etc/backup/quotatab.conf ]then echo -e "Can't found /etc/quotatab.conf. Aborting..." ; exitfiIFS=$'\n'for line in `/bin/cat /etc/quotatab.conf`doIFS=$'" "\t\n'host=`echo $line | awk '{print $1}'`/usr/sbin/setquota $line/usr/sbin/repquota -as | grep $hostdone