v_change_sys_ip_name 1.2 KB

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