Skip to content

Commit 8a4fdf7

Browse files
authored
Merge pull request hestiacp#1225 from hestiacp/feature/2020-09-include_original_templates
Backup used templates in user template
2 parents 61e59ad + f4693c3 commit 8a4fdf7

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

bin/v-backup-user

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,26 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB" != '*' ]; then
209209
fi
210210
fi
211211

212+
domain_conf=$(grep "DOMAIN='$domain'" $conf)
213+
parse_object_kv_list_non_eval domain_conf
214+
215+
mkdir -p template/$WEB_SYSTEM/
216+
mkdir template/php-fpm/
217+
218+
if [ $WEB_BACKEND == 'php-fpm' ]; then
219+
cp $HESTIA/data/templates/web/$WEB_SYSTEM/php-fpm/$TPL.tpl template/$WEB_SYSTEM/
220+
cp $HESTIA/data/templates/web/$WEB_SYSTEM/php-fpm/$TPL.stpl template/$WEB_SYSTEM/
221+
cp $HESTIA/data/templates/web/php-fpm/$BACKEND.tpl template/php-fpm/
222+
else
223+
cp $HESTIA/data/templates/web/$WEB_SYSTEM/$TPL.tpl template/$WEB_SYSTEM/
224+
cp $HESTIA/data/templates/web/$WEB_SYSTEM/$TPL.stpl template/$WEB_SYSTEM/
225+
fi
226+
if [ ! -z "$PROXY_SYSTEM" ] && [ ! -z "$PROXY" ]; then
227+
mkdir template/$PROXY_SYSTEM
228+
cp $HESTIA/data/templates/web/$PROXY_SYSTEM/$PROXY.tpl template/$PROXY_SYSTEM/
229+
cp $HESTIA/data/templates/web/$PROXY_SYSTEM/$PROXY.stpl. template/$PROXY_SYSTEM/
230+
fi
231+
212232
# Backup custom config / backup LE config
213233
for sconfig in $(ls $HOMEDIR/$user/conf/web/|grep ".$domain.conf"); do
214234
cp $HOMEDIR/$user/conf/web/$sconfig conf/
@@ -545,6 +565,7 @@ if [ "$USER" != '*' ]; then
545565
tee -a $BACKUP/$user.log
546566
fi
547567
fi
568+
548569
if [ "$BACKUP_MODE" = 'zstd' ]; then
549570
touch $tmpdir/.zstd
550571
fi

0 commit comments

Comments
 (0)