v_list_sys_ips 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/bin/bash
  2. # info: listing system users
  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/ip_func.sh
  14. #----------------------------------------------------------#
  15. # Verifications #
  16. #----------------------------------------------------------#
  17. # Checking argument format
  18. format_validation 'limit' 'offset'
  19. #----------------------------------------------------------#
  20. # Action #
  21. #----------------------------------------------------------#
  22. # Defining fileds to select
  23. fields='$IP $OWNER $STATUS $NAME $U_SYS_USERS $U_WEB_DOMAINS
  24. $INTERFACE $NETMASK $DATE'
  25. # Listing domains
  26. case $format in
  27. json) ip_json_list ;;
  28. shell) fields='$IP $NETMASK $OWNER $STATUS $U_WEB_DOMAINS';
  29. ip_shell_list | column -t ;;
  30. *) check_args '1' '0' '[format] [limit] [offset]'
  31. esac
  32. #----------------------------------------------------------#
  33. # Vesta #
  34. #----------------------------------------------------------#
  35. # Logging
  36. log_event 'system' "$V_EVENT"
  37. exit $OK