source: alternc/trunk/src/quota_edit @ 3132

Revision 3132, 580 bytes checked in by squidly, 15 months ago (diff)

ajout classe m_export + script export_account afin de générer un export de compte. Correction de bugs divers.

Line 
1#!/bin/bash
2. /etc/alternc/local.sh
3# Set disk quota to an user
4# Won't work over NFS
5
6MID=$1
7SIZE=$2
8AWK=/usr/bin/awk
9QUOTA=/usr/sbin/setquota
10if [ $# -ne 2 ] || [[ ! "$MID" =~ ^[0-9]+$ ]] || [[ ! "$SIZE" =~ ^[0-9]+$ ]]; then
11  echo "Usage: quota_edit <uid> <size>"
12  echo "Edit the quota of the AlternC account having uid <uid> the the available space to <size>"
13  exit 1
14fi
15
16DATA_PART=`df "${ALTERNC_LOC}/html" 2>/dev/null | $AWK 'NR==2 { print $1; }'`
17`sudo $QUOTA -r -g $MID $SIZE $SIZE 0 0 $DATA_PART 2>/dev/null || echo "Group quota are not enabled on /var/alternc." >&2`
Note: See TracBrowser for help on using the repository browser.