Files
VestaCP/bin/v_change_sys_ip_name
2012-04-30 12:32:11 +03:00

47 lines
1.1 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 defenition
ip=$1
ip_name=$2
# Includes
source $VESTA/conf/vesta.conf
source $VESTA/func/main.sh
source $VESTA/func/ip.sh
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '2' "$#" 'ip ip_name'
validate_format 'ip' 'ip_name'
is_ip_valid
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Changing ip name
update_ip_value '$NAME' "$ip_name"
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Logging
log_event "$OK" "$EVENT"
exit