v_del_db_host 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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_FUNC/shared_func.sh
  12. source $V_FUNC/db_func.sh
  13. #----------------------------------------------------------#
  14. # Verifications #
  15. #----------------------------------------------------------#
  16. # Checking arg number
  17. check_args '2' "$#" 'type host'
  18. # Checking argument format
  19. format_validation 'host'
  20. # Checking db system is enabled
  21. is_system_enabled 'db'
  22. # Checking db type
  23. is_type_valid 'db' "$type"
  24. # Checking host existance
  25. is_db_host_valid
  26. # Checking db host users
  27. is_db_host_free
  28. #----------------------------------------------------------#
  29. # Action #
  30. #----------------------------------------------------------#
  31. # Deleting host from conf
  32. del_dbhost_vesta
  33. #----------------------------------------------------------#
  34. # Vesta #
  35. #----------------------------------------------------------#
  36. # Logging
  37. log_event 'system' "$V_EVENT"
  38. exit $OK