2 source /etc/alternc/local.sh
4 # Set disk quota to an user
12 QUOTA=/usr/sbin/setquota
15 #checking if quotas are installed
16 command -v $QUOTA >/dev/null || { echo "Quotas uninstalled"; exit 1; }
18 if [ $# -ne 2 ] || [[ ! "$MID" =~ ^[0-9]+$ ]] || [[ ! "$SIZE" =~ ^[0-9]+$ ]]; then
19 echo "Usage: quota_edit <uid> <size>"
20 echo "Edit the quota of the AlternC account having uid <uid> the the available space to <size>"
24 DATA_PART=`$DF -P "${ALTERNC_HTML}" 2>/dev/null | $AWK 'NR==2 { print $NF }'`
26 if [[ ! -e $DATA_PART"/aquota.group" ]]; then
27 echo "Group quota are not enabled on $DATA_PART filesystem "
32 sudo $QUOTA -r -g $MID $SIZE 0 0 0 $DATA_PART 2>/dev/null || echo "Group quota are not enabled on $ALTERNC_HTML." >&2