From 62a495bd211df62fe3ec03a73a183324142d1b67 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Mon, 7 Sep 2015 16:43:54 +0300 Subject: [PATCH] fix for fs quota unlim --- bin/v-update-user-quota | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/bin/v-update-user-quota b/bin/v-update-user-quota index f248662ed..85330e450 100755 --- a/bin/v-update-user-quota +++ b/bin/v-update-user-quota @@ -31,12 +31,19 @@ is_object_valid 'user' 'USER' "$user" #----------------------------------------------------------# # Updating disk quota -soft=$(get_user_value '$DISK_QUOTA') -soft=$((soft * 1000)) -hard=$((soft + 50000)) +quota=$(get_user_value '$DISK_QUOTA') +soft=$((quota * 1000)) +hard=$((quota + 50000)) +# Searching home mount point mnt=$(df -P /home |awk '{print $6}' |tail -n1) -setquota $user $soft $hard 0 0 $mnt + +# Checking unlinmited quota +if [ "$quota" = 'unlimited' ]; then + setquota $user 0 0 0 0 $mnt +else + setquota $user $soft $hard 0 0 $mnt +fi #----------------------------------------------------------#