v_change_sys_ip_name 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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_FUNC/shared_func.sh
  12. source $V_FUNC/ip_func.sh
  13. #----------------------------------------------------------#
  14. # Verifications #
  15. #----------------------------------------------------------#
  16. # Checking arg number
  17. check_args '2' "$#" 'ip ip_name'
  18. # Checking argument format
  19. format_validation 'ip' 'ip_name'
  20. # Checking system ip
  21. is_sys_ip_valid
  22. #----------------------------------------------------------#
  23. # Action #
  24. #----------------------------------------------------------#
  25. # Changing ip name
  26. update_sys_ip_value '$NAME' "$ip_name"
  27. #----------------------------------------------------------#
  28. # Vesta #
  29. #----------------------------------------------------------#
  30. # Logging
  31. log_event 'system' "$V_EVENT"
  32. exit $OK