2012-02-06 08:28:40 +00:00
|
|
|
#!/bin/bash
|
|
|
|
. /etc/alternc/local.sh
|
2006-05-12 11:17:23 +00:00
|
|
|
|
2012-02-06 08:28:40 +00:00
|
|
|
# Set disk quota to an user
|
|
|
|
# Won't work over NFS
|
2006-05-12 11:17:23 +00:00
|
|
|
|
2012-02-06 08:28:40 +00:00
|
|
|
MID=$1
|
|
|
|
SIZE=$2
|
2006-05-12 11:17:23 +00:00
|
|
|
|
2012-02-06 08:28:40 +00:00
|
|
|
if [ $# -ne 2 ] || [[ ! "$MID" =~ ^[0-9]+$ ]] || [[ ! "$SIZE" =~ ^[0-9]+$ ]]; then
|
|
|
|
echo "Usage: quota_edit <uid> <size>"
|
|
|
|
echo "Edit the quota of the AlternC account having uid <uid> the the available space to <size>"
|
|
|
|
exit 1
|
|
|
|
fi
|
2006-05-12 11:17:23 +00:00
|
|
|
|
2012-02-06 08:28:40 +00:00
|
|
|
DATA_PART=`$DF "${ALTERNC_LOC}/html" 2>/dev/null | $AWK 'NR==2 { print $1 }'`
|
|
|
|
/usr/sbin/setquota -r -g $MID $SIZE $SIZE 0 0 $DATA_PART 2>/dev/null || echo "Group quota are not enabled on /var/alternc." >&2
|