| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- #!/bin/bash
- # info: listing system ip
- #----------------------------------------------------------#
- # Variable&Function #
- #----------------------------------------------------------#
- # Argument defenition
- ip="$1"
- format="${2-shell}"
- # Importing variables
- source $VESTA/conf/vars.conf
- source $V_FUNC/shared_func.sh
- source $V_FUNC/ip_func.sh
- #----------------------------------------------------------#
- # Verifications #
- #----------------------------------------------------------#
- # Checking args
- check_args '1' "$#" 'ip [format]'
- # Checking argument format
- format_validation 'ip'
- # Checking ip
- is_sys_ip_valid
- #----------------------------------------------------------#
- # Action #
- #----------------------------------------------------------#
- # Defining fileds to select
- fields='$IP $OWNER $STATUS $NAME $U_SYS_USERS $U_WEB_DOMAINS
- $INTERFACE $NETMASK $DATE'
- # Listing ip
- case $format in
- json) ip_json_single_list ;;
- shell) ip_shell_single_list | column -t ;;
- *) check_args '1' "0" 'ip [format]'
- esac
- #----------------------------------------------------------#
- # Vesta #
- #----------------------------------------------------------#
- # Logging
- log_event 'system' "$V_EVENT"
- exit $OK
|