Skip to content

Commit 62a495b

Browse files
committed
fix for fs quota unlim
1 parent 2850492 commit 62a495b

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

bin/v-update-user-quota

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,19 @@ is_object_valid 'user' 'USER' "$user"
3131
#----------------------------------------------------------#
3232

3333
# Updating disk quota
34-
soft=$(get_user_value '$DISK_QUOTA')
35-
soft=$((soft * 1000))
36-
hard=$((soft + 50000))
34+
quota=$(get_user_value '$DISK_QUOTA')
35+
soft=$((quota * 1000))
36+
hard=$((quota + 50000))
3737

38+
# Searching home mount point
3839
mnt=$(df -P /home |awk '{print $6}' |tail -n1)
39-
setquota $user $soft $hard 0 0 $mnt
40+
41+
# Checking unlinmited quota
42+
if [ "$quota" = 'unlimited' ]; then
43+
setquota $user 0 0 0 0 $mnt
44+
else
45+
setquota $user $soft $hard 0 0 $mnt
46+
fi
4047

4148

4249
#----------------------------------------------------------#

0 commit comments

Comments
 (0)