mirror of
https://github.com/myvesta/vesta.git
synced 2024-12-21 11:31:21 -08:00
49 lines
1.2 KiB
Bash
Executable File
49 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
# info: change ip name
|
|
# options: IP NAME
|
|
#
|
|
# The function for changing dns domain associated with ip.
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Variable&Function #
|
|
#----------------------------------------------------------#
|
|
|
|
# Argument definition
|
|
ip=$1
|
|
ip_name=$2
|
|
|
|
# Includes
|
|
source $VESTA/func/main.sh
|
|
source $VESTA/func/ip.sh
|
|
source $VESTA/conf/vesta.conf
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Verifications #
|
|
#----------------------------------------------------------#
|
|
|
|
check_args '2' "$#" 'IP IP_NAME'
|
|
is_format_valid 'ip'
|
|
is_format_valid 'ip_name'
|
|
is_ip_valid "$ip"
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Action #
|
|
#----------------------------------------------------------#
|
|
|
|
# Changing ip name
|
|
update_ip_value '$NAME' "$ip_name"
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Vesta #
|
|
#----------------------------------------------------------#
|
|
|
|
# Logging
|
|
log_history "changed associated dns on $ip to $ip_name" '' 'admin'
|
|
log_event "$OK" "$ARGUMENTS"
|
|
|
|
exit
|