From a2eae62f3e0b1476d6a8912e228bd5749cea8c30 Mon Sep 17 00:00:00 2001 From: Steven Mondji-Lerider Date: Wed, 7 Nov 2012 16:42:57 +0000 Subject: [PATCH] Bugfixing quotas bash scripts if quotas package not installed --- src/quota_edit | 4 ++++ src/quota_get | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/quota_edit b/src/quota_edit index 7e36d4d5..db40bc68 100755 --- a/src/quota_edit +++ b/src/quota_edit @@ -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 " echo "Edit the quota of the AlternC account having uid the the available space to " diff --git a/src/quota_get b/src/quota_get index 372dcd90..46114169 100755 --- a/src/quota_get +++ b/src/quota_get @@ -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