Bugfixing quotas bash scripts if quotas package not installed
This commit is contained in:
parent
03fbbb97bd
commit
a2eae62f3e
|
@ -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>"
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue