v-suspend-database-host 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/bin/bash
  2. # info: suspend database server
  3. # options: TYPE HOST
  4. # labels: panel
  5. #
  6. # example: v-suspend-database-host mysql localhost
  7. #
  8. # The function for suspending a database server.
  9. #----------------------------------------------------------#
  10. # Variable&Function #
  11. #----------------------------------------------------------#
  12. # Argument definition
  13. type=$1
  14. host=$2
  15. # Includes
  16. source $HESTIA/func/main.sh
  17. source $HESTIA/conf/hestia.conf
  18. #----------------------------------------------------------#
  19. # Verifications #
  20. #----------------------------------------------------------#
  21. check_args '2' "$#" 'TYPE HOST'
  22. is_format_valid 'type' 'host'
  23. is_system_enabled "$DB_SYSTEM" 'DB_SYSTEM'
  24. is_object_valid "../../conf/$type" 'HOST' "$host"
  25. is_object_unsuspended "../../conf/$type" 'HOST' "$host"
  26. # Perform verification if read-only mode is enabled
  27. check_hestia_demo_mode
  28. #----------------------------------------------------------#
  29. # Action #
  30. #----------------------------------------------------------#
  31. # Suspend database creation on a server
  32. update_object_value "../../conf/$type" 'HOST' "$host" '$SUSPENDED' 'yes'
  33. #----------------------------------------------------------#
  34. # Hestia #
  35. #----------------------------------------------------------#
  36. # Logging
  37. log_event "$OK" "$ARGUMENTS"
  38. exit