v-list-web-domain-errorlog 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/bin/bash
  2. # info: list web domain error log
  3. # options: USER DOMAIN [LINES]
  4. #
  5. # The function of obtaining raw error web domain logs.
  6. #----------------------------------------------------------#
  7. # Variable&Function #
  8. #----------------------------------------------------------#
  9. # Argument defenition
  10. user=$1
  11. domain=$2
  12. lines=${3-70}
  13. # Includes
  14. source $VESTA/func/main.sh
  15. source $VESTA/conf/vesta.conf
  16. #----------------------------------------------------------#
  17. # Verifications #
  18. #----------------------------------------------------------#
  19. check_args '2' "$#" 'USER DOMAIN [FORMAT]'
  20. is_object_valid 'user' 'USER' "$user"
  21. is_object_valid 'web' 'DOMAIN' "$domain"
  22. #----------------------------------------------------------#
  23. # Action #
  24. #----------------------------------------------------------#
  25. # Check number of output lines
  26. if [ "$lines" -gt '3000' ]; then
  27. read_cmd="cat"
  28. else
  29. read_cmd="tail -n $lines"
  30. fi
  31. $read_cmd /var/log/$WEB_SYSTEM/domains/$domain.error.log
  32. #----------------------------------------------------------#
  33. # Vesta #
  34. #----------------------------------------------------------#
  35. exit