forked from outroll/vesta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathv-change-sys-ip-name
executable file
·50 lines (36 loc) · 1.25 KB
/
v-change-sys-ip-name
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/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/func/main.sh
source $VESTA/func/ip.sh
source $VESTA/conf/vesta.conf
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '2' "$#" 'IP IP_NAME'
validate_format 'ip'
if [ ! -z "$ip_name" ]; then
validate_format 'ip_name'
fi
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