myvesta/bin/v-change-sys-ipv6-name
2024-04-14 22:28:39 +02:00

49 lines
1.2 KiB
Bash

#!/bin/bash
# info: change ip name
# options: IPV6 NAME
#
# The function for changing the name of the ip.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument definition
ipv6=$1
ip_name=$2
# Includes
source $VESTA/func/main.sh
source $VESTA/func/ipv6.sh
source $VESTA/conf/vesta.conf
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '2' "$#" 'IPV6 IP_NAME'
is_format_valid 'ipv6'
is_format_valid 'ip_name'
is_ipv6_valid "$ipv6"
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Changing ip name
update_ipv6_value '$NAME' "$ip_name"
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Logging
log_history "changed associated name of $ipv6 to $ip_name" '' 'admin'
log_event "$OK" "$ARGUMENTS"
exit