v_list_dns_templates 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/bash
  2. # info: listing dns templates
  3. #----------------------------------------------------------#
  4. # Variable&Function #
  5. #----------------------------------------------------------#
  6. # Argument defenition
  7. format="${1-shell}"
  8. limit="${2-1000}"
  9. offset="${3-1}"
  10. # Importing variables
  11. source $VESTA/conf/vars.conf
  12. source $V_FUNC/shared_func.sh
  13. source $V_FUNC/domain_func.sh
  14. #----------------------------------------------------------#
  15. # Verifications #
  16. #----------------------------------------------------------#
  17. # Checking argument format
  18. format_validation 'limit' 'offset'
  19. #----------------------------------------------------------#
  20. # Action #
  21. #----------------------------------------------------------#
  22. # Listing domains
  23. case $format in
  24. json) dnstpl_json_list ;;
  25. shell) dnstpl_shell_list ;;
  26. *) check_args '1' "0" '[format] [limit] [offset]'
  27. esac
  28. #----------------------------------------------------------#
  29. # Vesta #
  30. #----------------------------------------------------------#
  31. # Logging
  32. log_event 'system' "$V_EVENT"
  33. exit $OK