mirror of
https://github.com/myvesta/vesta.git
synced 2024-12-21 11:31:21 -08:00
48 lines
1.2 KiB
Bash
Executable File
48 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
# info: update dns templates
|
|
# options: [RESTART]
|
|
#
|
|
# The function for obtaining updated pack of dns templates.
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Variable&Function #
|
|
#----------------------------------------------------------#
|
|
|
|
# Argument definition
|
|
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 https://c.myvestacp.com/debian/10/templates.tar.gz -q
|
|
if [ "$?" -ne 0 ]; then
|
|
echo "Error: can't download template.tar.gz"
|
|
log_event "$E_CONNECT" "$ARGUMENTS"
|
|
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
|