v_add_sys_user_reports 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #!/bin/bash
  2. # info: adding user reports
  3. #----------------------------------------------------------#
  4. # Variable&Function #
  5. #----------------------------------------------------------#
  6. # Argument defenition
  7. user=$1
  8. # Importing variables
  9. source $VESTA/conf/vars.conf
  10. source $V_CONF/vesta.conf
  11. source $V_FUNC/shared.func
  12. source $V_FUNC/cron.func
  13. #----------------------------------------------------------#
  14. # Verifications #
  15. #----------------------------------------------------------#
  16. # Checking arg number
  17. check_args '1' "$#" 'user'
  18. # Checking argument format
  19. format_validation 'user'
  20. # Checking user
  21. is_user_valid
  22. # Checking user is active
  23. is_user_suspended
  24. #----------------------------------------------------------#
  25. # Action #
  26. #----------------------------------------------------------#
  27. # Changing user report value
  28. update_user_value "$user" '$REPORTS' 'yes'
  29. # Sync system cron with user
  30. sync_cron_jobs
  31. #----------------------------------------------------------#
  32. # Vesta #
  33. #----------------------------------------------------------#
  34. # Adding task to the vesta pipe
  35. restart_schedule 'cron'
  36. # Logging
  37. log_history "$V_EVENT" "v_del_sys_user_reports $user"
  38. log_event 'system' "$V_EVENT"
  39. exit