Skip to content

Commit 349308e

Browse files
committed
update vesta templates
1 parent 780641b commit 349308e

File tree

2 files changed

+105
-0
lines changed

2 files changed

+105
-0
lines changed

bin/v-update-dns-templates

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/bash
2+
# info: update dns templates
3+
# options: [RESTART]
4+
#
5+
# The function for obtaining updated pack of dns templates.
6+
7+
8+
#----------------------------------------------------------#
9+
# Variable&Function #
10+
#----------------------------------------------------------#
11+
12+
# Argument defenition
13+
restart=$1
14+
15+
# Includes
16+
source $VESTA/conf/vesta.conf
17+
source $VESTA/func/main.sh
18+
19+
20+
#----------------------------------------------------------#
21+
# Action #
22+
#----------------------------------------------------------#
23+
24+
# Get new archive
25+
tmpdir=$(mktemp -d --dry-run)
26+
mkdir $tmpdir
27+
cd $tmpdir
28+
wget http://c.vestacp.com/0.9.8/rhel/templates.tar.gz -q
29+
if [ "$?" -ne 0 ]; then
30+
echo "Error: can't download template.tar.gz"
31+
log_event "$E_CONNECT" "$EVENT"
32+
rm -rf $tmpdir
33+
exit $E_CONNECT
34+
fi
35+
36+
# Update templates
37+
tar -xzpf templates.tar.gz -C $VESTA/data/ templates/dns
38+
39+
40+
#----------------------------------------------------------#
41+
# Vesta #
42+
#----------------------------------------------------------#
43+
44+
# Clean tmpdir
45+
rm -rf $tmpdir
46+
47+
exit

bin/v-update-web-templates

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#!/bin/bash
2+
# info: updates web templates
3+
# options: [RESTART]
4+
#
5+
# The function for obtaining updated pack of web templates.
6+
7+
8+
#----------------------------------------------------------#
9+
# Variable&Function #
10+
#----------------------------------------------------------#
11+
12+
# Argument defenition
13+
restart=$1
14+
15+
# Includes
16+
source $VESTA/conf/vesta.conf
17+
source $VESTA/func/main.sh
18+
19+
20+
#----------------------------------------------------------#
21+
# Action #
22+
#----------------------------------------------------------#
23+
24+
# Get new archive
25+
tmpdir=$(mktemp -d --dry-run)
26+
mkdir $tmpdir
27+
cd $tmpdir
28+
wget http://c.vestacp.com/0.9.8/rhel/templates.tar.gz -q
29+
if [ "$?" -ne 0 ]; then
30+
echo "Error: can't download template.tar.gz"
31+
log_event "$E_CONNECT" "$EVENT"
32+
rm -rf $tmpdir
33+
exit $E_CONNECT
34+
fi
35+
36+
# Update templates
37+
tar -xzpf templates.tar.gz -C $VESTA/data/ templates/web
38+
39+
# Rebuild web domains
40+
for user in $($BIN/v-list-sys-users plain); do
41+
$BIN/v-rebuild-web-domains $user no
42+
done
43+
44+
45+
#----------------------------------------------------------#
46+
# Vesta #
47+
#----------------------------------------------------------#
48+
49+
# Restart web server
50+
if [ "$restart" != 'no' ]; then
51+
$BIN/v-restart-web
52+
$BIN/v-restart-proxy
53+
fi
54+
55+
# Delete tmpdir
56+
rm -rf $tmpdir
57+
58+
exit

0 commit comments

Comments
 (0)