| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- #!/bin/bash
- # info: get user value
- # options: USER KEY
- # labels: panel
- #
- # example: v-get-user-value admin FNAME
- #
- # The function for obtaining certain user's parameters.
- #----------------------------------------------------------#
- # Variable&Function #
- #----------------------------------------------------------#
- # Argument definition
- user=$1
- key=$(echo "$2"| tr '[:lower:]' '[:upper:]' | sed "s/^/$/")
- # Includes
- # shellcheck source=/usr/local/hestia/func/main.sh
- source $HESTIA/func/main.sh
- #----------------------------------------------------------#
- # Verifications #
- #----------------------------------------------------------#
- check_args '2' "$#" 'USER KEY'
- is_format_valid 'user'
- is_object_valid 'user' 'USER' "$user"
- #----------------------------------------------------------#
- # Action #
- #----------------------------------------------------------#
- # Checking key
- value=$(get_user_value "$key")
- # Printing value
- echo "$value"
- #----------------------------------------------------------#
- # Hestia #
- #----------------------------------------------------------#
- exit
|