v_change_sys_ip_name 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/bin/bash
  2. # info: change ip name
  3. # options: ip name
  4. #
  5. # The function for changing dns domain associated with ip.
  6. #----------------------------------------------------------#
  7. # Variable&Function #
  8. #----------------------------------------------------------#
  9. # Argument defenition
  10. ip=$1
  11. ip_name=$2
  12. # Importing variables
  13. source $VESTA/conf/vars.conf
  14. source $V_CONF/vesta.conf
  15. source $V_FUNC/shared.func
  16. source $V_FUNC/ip.func
  17. #----------------------------------------------------------#
  18. # Verifications #
  19. #----------------------------------------------------------#
  20. # Checking arg number
  21. check_args '2' "$#" 'ip ip_name'
  22. # Checking argument format
  23. format_validation 'ip' 'ip_name'
  24. # Checking system ip
  25. is_sys_ip_valid
  26. #----------------------------------------------------------#
  27. # Action #
  28. #----------------------------------------------------------#
  29. # Changing ip name
  30. update_sys_ip_value '$NAME' "$ip_name"
  31. #----------------------------------------------------------#
  32. # Vesta #
  33. #----------------------------------------------------------#
  34. # Logging
  35. log_event 'system' "$V_EVENT"
  36. exit