v-rebuild-user 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/bin/bash
  2. # info: rebuild system user
  3. # options: USER [RESTART]
  4. #
  5. # The function rebuilds system user account.
  6. #----------------------------------------------------------#
  7. # Variable&Function #
  8. #----------------------------------------------------------#
  9. # Argument definition
  10. user=$1
  11. restart=$2
  12. # Includes
  13. source $VESTA/func/main.sh
  14. source $VESTA/func/rebuild.sh
  15. source $VESTA/conf/vesta.conf
  16. # Export sbin
  17. export PATH=$PATH:/usr/sbin
  18. #----------------------------------------------------------#
  19. # Verifications #
  20. #----------------------------------------------------------#
  21. check_args '1' "$#" 'USER [RESTART]'
  22. is_format_valid 'user'
  23. is_object_valid 'user' 'USER' "$user"
  24. is_object_unsuspended 'user' 'USER' "$user"
  25. #----------------------------------------------------------#
  26. # Action #
  27. #----------------------------------------------------------#
  28. # Update disk quota
  29. if [ "$DISK_QUOTA" = 'yes' ]; then
  30. $BIN/v-update-user-quota $user
  31. fi
  32. # Rebuild user
  33. rebuild_user_conf
  34. #----------------------------------------------------------#
  35. # Vesta #
  36. #----------------------------------------------------------#
  37. # Logging
  38. log_event "$OK" "$ARGUMENTS"
  39. exit