v-unsuspend-dns-domain 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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=$(idn -t --quiet -u "$2" )
  12. domain_idn=$(idn -t --quiet -a "$domain")
  13. restart="$3"
  14. # Includes
  15. source $VESTA/func/main.sh
  16. source $VESTA/conf/vesta.conf
  17. #----------------------------------------------------------#
  18. # Verifications #
  19. #----------------------------------------------------------#
  20. check_args '2' "$#" 'USER DOMAIN'
  21. is_format_valid 'user' 'domain'
  22. is_system_enabled "$DNS_SYSTEM" 'DNS_SYSTEM'
  23. is_object_valid 'user' 'USER' "$user"
  24. is_object_valid 'dns' 'DOMAIN' "$domain"
  25. is_object_suspended 'dns' 'DOMAIN' "$domain"
  26. #----------------------------------------------------------#
  27. # Action #
  28. #----------------------------------------------------------#
  29. #----------------------------------------------------------#
  30. # Vesta #
  31. #----------------------------------------------------------#
  32. # Unsuspending domain in config
  33. update_object_value 'dns' 'DOMAIN' "$domain" '$SUSPENDED' 'no'
  34. decrease_user_value "$user" '$SUSPENDED_DNS'
  35. sed -i "s/SUSPENDED='yes'/SUSPENDED='no'/g" $USER_DATA/dns/$domain.conf
  36. # Logging
  37. log_event "$OK" "$ARGUMENTS"
  38. exit