v_delete_db_host 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #!/bin/bash
  2. # info: adding data base server
  3. #----------------------------------------------------------#
  4. # Variable&Function #
  5. #----------------------------------------------------------#
  6. # Argument defenition
  7. type=$1
  8. host=$2
  9. # Importing variables
  10. source $VESTA/conf/vars.conf
  11. source $V_CONF/vesta.conf
  12. source $V_FUNC/shared.func
  13. source $V_FUNC/db.func
  14. #----------------------------------------------------------#
  15. # Verifications #
  16. #----------------------------------------------------------#
  17. # Checking arg number
  18. check_args '2' "$#" 'type host'
  19. # Checking argument format
  20. format_validation 'host'
  21. # Checking db system is enabled
  22. is_system_enabled 'db'
  23. # Checking db type
  24. is_type_valid 'db' "$type"
  25. # Checking host existance
  26. is_db_host_valid
  27. # Checking db host users
  28. is_db_host_free
  29. #----------------------------------------------------------#
  30. # Action #
  31. #----------------------------------------------------------#
  32. # Deleting host from conf
  33. del_dbhost_vesta
  34. #----------------------------------------------------------#
  35. # Vesta #
  36. #----------------------------------------------------------#
  37. # Logging
  38. log_event 'system' "$V_EVENT"
  39. exit