| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- #!/bin/bash
- # info: list proftpd config parameters
- # options: [FORMAT]
- #
- # The function for obtaining the list of proftpd config parameters.
- #----------------------------------------------------------#
- # Variable&Function #
- #----------------------------------------------------------#
- # Argument definition
- format=${1-shell}
- # Includes
- source $VESTA/func/main.sh
- # JSON list function
- json_list() {
- echo '{
- "CONFIG": {
- "config_path": "'$config_path'"
- }
- }'
- }
- # SHELL list function
- shell_list() {
- echo "config_path: $config_path"
- }
- # PLAIN list function
- plain_list() {
- echo "$config_path"
- }
- # CSV list function
- csv_list() {
- echo "config_path"
- echo "$config_path"
- }
- #----------------------------------------------------------#
- # Action #
- #----------------------------------------------------------#
- # Defining config path
- config_path=$(find /etc/proftpd* -name proftpd.conf 2>/dev/null)
- # Listing data
- case $format in
- json) json_list ;;
- plain) plain_list ;;
- csv) csv_list ;;
- shell) shell_list;;
- esac
- #----------------------------------------------------------#
- # Vesta #
- #----------------------------------------------------------#
- exit
|