mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 10:37:42 -07:00
File system quota support
This commit is contained in:
parent
391c6ca5c5
commit
9087a5b57a
5 changed files with 214 additions and 7 deletions
49
bin/v-update-user-quota
Executable file
49
bin/v-update-user-quota
Executable file
|
@ -0,0 +1,49 @@
|
|||
#!/bin/bash
|
||||
# info: update user disk quota
|
||||
# options: USER
|
||||
#
|
||||
# The functions upates disk quota for specific user
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Variable&Function #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Argument defenition
|
||||
user=$1
|
||||
|
||||
# Includes
|
||||
source $VESTA/func/main.sh
|
||||
source $VESTA/conf/vesta.conf
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Verifications #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
check_args '1' "$#" 'USER'
|
||||
validate_format 'user'
|
||||
is_object_valid 'user' 'USER' "$user"
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Updating disk quota
|
||||
soft=$(get_user_value '$DISK_QUOTA')
|
||||
soft=$((soft * 100))
|
||||
hard=$((soft + 50000))
|
||||
|
||||
mnt=$(df -P /home |awk '{print $6}' |tail -n1)
|
||||
setquota $user $soft $hard 0 0 $mnt
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Vesta #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Logging
|
||||
log_event "$OK" "$EVENT"
|
||||
|
||||
exit
|
Loading…
Add table
Add a link
Reference in a new issue