v-change-sys-ipv6-name 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/bin/bash
  2. # info: change ip name
  3. # options: IPV6 NAME
  4. #
  5. # The function for changing the name of the ip.
  6. #----------------------------------------------------------#
  7. # Variable&Function #
  8. #----------------------------------------------------------#
  9. # Argument definition
  10. ipv6=$1
  11. ip_name=$2
  12. # Includes
  13. source $HESTIA/func/main.sh
  14. source $HESTIA/func/ipv6.sh
  15. source $HESTIA/conf/hestia.conf
  16. #----------------------------------------------------------#
  17. # Verifications #
  18. #----------------------------------------------------------#
  19. check_args '2' "$#" 'IPV6 IP_NAME'
  20. is_format_valid 'ipv6'
  21. is_format_valid 'ip_name'
  22. is_ipv6_valid "$ipv6"
  23. #----------------------------------------------------------#
  24. # Action #
  25. #----------------------------------------------------------#
  26. # Changing ip name
  27. update_ipv6_value '$NAME' "$ip_name"
  28. #----------------------------------------------------------#
  29. # Hestia #
  30. #----------------------------------------------------------#
  31. # Logging
  32. log_history "changed associated name of $ipv6 to $ip_name" '' 'admin'
  33. log_event "$OK" "$ARGUMENTS"
  34. exit