| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- #!/bin/bash
- # info: rebuild system user
- # options: USER [RESTART]
- #
- # The function rebuilds system user account.
- #----------------------------------------------------------#
- # Variable&Function #
- #----------------------------------------------------------#
- # Argument definition
- user=$1
- restart=$2
- # Includes
- source $VESTA/func/main.sh
- source $VESTA/func/rebuild.sh
- source $VESTA/conf/vesta.conf
- # Export sbin
- export PATH=$PATH:/usr/sbin
- #----------------------------------------------------------#
- # Verifications #
- #----------------------------------------------------------#
- check_args '1' "$#" 'USER [RESTART]'
- is_format_valid 'user'
- is_object_valid 'user' 'USER' "$user"
- is_object_unsuspended 'user' 'USER' "$user"
- #----------------------------------------------------------#
- # Action #
- #----------------------------------------------------------#
- # Update disk quota
- if [ "$DISK_QUOTA" = 'yes' ]; then
- $BIN/v-update-user-quota $user
- fi
- # Rebuild user
- rebuild_user_conf
- #----------------------------------------------------------#
- # Vesta #
- #----------------------------------------------------------#
- # Logging
- log_event "$OK" "$ARGUMENTS"
- exit
|