| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- #!/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_history "changed associated dns on $ip to $domain" '' 'admin'
- log_event "$OK" "$EVENT"
- exit
|