v-list-sys-proftpd-config 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #!/bin/bash
  2. # info: list proftpd config parameters
  3. # options: [FORMAT]
  4. #
  5. # The function for obtaining the list of proftpd config parameters.
  6. #----------------------------------------------------------#
  7. # Variable&Function #
  8. #----------------------------------------------------------#
  9. # Argument definition
  10. format=${1-shell}
  11. # Includes
  12. source $VESTA/func/main.sh
  13. # JSON list function
  14. json_list() {
  15. echo '{
  16. "CONFIG": {
  17. "config_path": "'$config_path'"
  18. }
  19. }'
  20. }
  21. # SHELL list function
  22. shell_list() {
  23. echo "config_path: $config_path"
  24. }
  25. # PLAIN list function
  26. plain_list() {
  27. echo "$config_path"
  28. }
  29. # CSV list function
  30. csv_list() {
  31. echo "config_path"
  32. echo "$config_path"
  33. }
  34. #----------------------------------------------------------#
  35. # Action #
  36. #----------------------------------------------------------#
  37. # Defining config path
  38. config_path=$(find /etc/proftpd* -name proftpd.conf 2>/dev/null)
  39. # Listing data
  40. case $format in
  41. json) json_list ;;
  42. plain) plain_list ;;
  43. csv) csv_list ;;
  44. shell) shell_list;;
  45. esac
  46. #----------------------------------------------------------#
  47. # Vesta #
  48. #----------------------------------------------------------#
  49. exit