Skip to content

Commit f1d67de

Browse files
committed
Modify template updater to use deb package content as sources.
1 parent 9626922 commit f1d67de

File tree

1 file changed

+9
-20
lines changed

1 file changed

+9
-20
lines changed

bin/v-update-web-templates

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,42 +21,31 @@ source $HESTIA/conf/hestia.conf
2121
# Action #
2222
#----------------------------------------------------------#
2323

24-
# Defining config host
25-
chost='c.vestacp.com'
26-
2724
# Detcing OS
2825
case $(head -n1 /etc/issue |cut -f 1 -d ' ') in
2926
Debian) version="debian" ;;
3027
Ubuntu) version="ubuntu" ;;
31-
*) version="rhel" ;;
28+
*) version="NotSupported" ;;
3229
esac
3330

3431
# Detecting release
35-
if [ "$version" = 'rhel' ]; then
36-
if [ -e '/etc/redhat-release' ]; then
37-
release=$(grep -o "[0-9]" /etc/redhat-release |head -n1)
38-
else
39-
release=6
40-
fi
41-
fi
4232
if [ "$version" = 'ubuntu' ]; then
4333
release=$(lsb_release -r |awk '{print $2}')
4434
fi
4535
if [ "$version" = 'debian' ]; then
4636
release=$(cat /etc/issue|grep -o [0-9]|head -n1)
4737
fi
38+
if [ "$version" = 'NotSupported' ]; then
39+
echo "No Supported OS Version found, abort."
40+
exit 1
41+
fi
4842

49-
# Defining download url
50-
vestacp="http://$chost/$version/$release"
51-
52-
# Downloading template archive
53-
cd $(mktemp -d)
54-
wget $vestacp/templates.tar.gz -q
55-
56-
check_result $? "can't download template.tar.gz" $E_CONNECT
43+
# Defining template path
44+
hestiacp="$HESTIA/install/$version/$release"
5745

5846
# Updating templates
59-
tar -xzpf templates.tar.gz -C $HESTIA/data/ templates/web
47+
cp -rf $hestiacp/templates/web $HESTIA/data/templates/
48+
6049

6150
# Rebuilding web domains
6251
for user in $($BIN/v-list-sys-users plain); do

0 commit comments

Comments
 (0)