forked from outroll/vesta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathv-update-dns-templates
executable file
·47 lines (35 loc) · 1.15 KB
/
v-update-dns-templates
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
#!/bin/bash
# info: update dns templates
# options: [RESTART]
#
# The function for obtaining updated pack of dns templates.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument defenition
restart=$1
# Includes
source $VESTA/func/main.sh
source $VESTA/conf/vesta.conf
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Get new archive
tmpdir=$(mktemp -d --dry-run)
mkdir $tmpdir
cd $tmpdir
wget http://c.vestacp.com/$VERSION/rhel/templates.tar.gz -q
if [ "$?" -ne 0 ]; then
echo "Error: can't download template.tar.gz"
log_event "$E_CONNECT" "$EVENT"
rm -rf $tmpdir
exit $E_CONNECT
fi
# Update templates
tar -xzpf templates.tar.gz -C $VESTA/data/ templates/dns
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Clean tmpdir
rm -rf $tmpdir
exit