| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- #!/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 $domain" '' 'admin'
- log_event "$OK" "$ARGUMENTS"
- exit
|