v-unsuspend-dns-domain 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/bin/bash
  2. # info: unsuspend dns domain
  3. # options: USER DOMAIN
  4. #
  5. # The function unsuspends a certain user's domain.
  6. #----------------------------------------------------------#
  7. # Variable&Function #
  8. #----------------------------------------------------------#
  9. # Argument definition
  10. user=$1
  11. domain=$2
  12. # Includes
  13. source $VESTA/func/main.sh
  14. source $VESTA/conf/vesta.conf
  15. # Additional argument formatting
  16. format_domain
  17. format_domain_idn
  18. #----------------------------------------------------------#
  19. # Verifications #
  20. #----------------------------------------------------------#
  21. check_args '2' "$#" 'USER DOMAIN'
  22. is_format_valid 'user' 'domain'
  23. is_system_enabled "$DNS_SYSTEM" 'DNS_SYSTEM'
  24. is_object_valid 'user' 'USER' "$user"
  25. is_object_valid 'dns' 'DOMAIN' "$domain"
  26. is_object_suspended 'dns' 'DOMAIN' "$domain"
  27. #----------------------------------------------------------#
  28. # Action #
  29. #----------------------------------------------------------#
  30. #----------------------------------------------------------#
  31. # Vesta #
  32. #----------------------------------------------------------#
  33. # Unsuspending domain in config
  34. update_object_value 'dns' 'DOMAIN' "$domain" '$SUSPENDED' 'no'
  35. decrease_user_value "$user" '$SUSPENDED_DNS'
  36. sed -i "s/SUSPENDED='yes'/SUSPENDED='no'/g" $USER_DATA/dns/$domain.conf
  37. # Logging
  38. log_event "$OK" "$ARGUMENTS"
  39. exit