Bugfixing quotas bash scripts if quotas package not installed

This commit is contained in:
Steven Mondji-Lerider 2012-11-07 16:42:57 +00:00
parent 03fbbb97bd
commit a2eae62f3e
2 changed files with 8 additions and 0 deletions

View File

@ -7,6 +7,10 @@ MID=$1
SIZE=$2
AWK=/usr/bin/awk
QUOTA=/usr/sbin/setquota
#checking if quotas are installed
command -v $QUOTA >/dev/null && continue || { echo "Quotas uninstalled"; exit 1; }
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>"

View File

@ -16,6 +16,10 @@ if [ "x$MID" == "x" ] ; then
exit 1
fi
#checking if quotas are installed
command -v $QUOTA >/dev/null && continue || { echo "Quotas uninstalled"; exit 0; }
# The second line is the one interesting
# We look precisely on the HTML directory. Why ? because it's surely
# the bigger one, and if someone separate it we need to look this one