Skip to content

Commit 135a795

Browse files
author
Kristan Kenney
committed
Merge branch 'refactor/scripts/v-update-web-templates' into staging/fixes
2 parents 7387a4b + ec1825b commit 135a795

File tree

1 file changed

+9
-29
lines changed

1 file changed

+9
-29
lines changed

bin/v-update-web-templates

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -27,41 +27,21 @@ if [ -d "${WEBTPL}" ]; then
2727
rm -rf "${WEBTPL}/unassigned" 2>/dev/null
2828
fi
2929

30-
for php_ver in $(ls /etc/php/); do
31-
[ ! -d "/etc/php/$php_ver/fpm/pool.d/" ] && continue
32-
cp -f "$HESTIA_INSTALL_DIR/php-fpm/multiphp.tpl" ${WEBTPL}/php-fpm/PHP-${php_ver/\./_}.tpl
33-
done
34-
35-
for webtpl_folder in $(ls $HESTIA_INSTALL_DIR/templates/web/* -d 2>/dev/null | egrep -v '/(nginx)$' ); do
36-
cp -rf "${webtpl_folder}" "${WEBTPL}/"
37-
done
38-
3930
[ -d "${WEBTPL}/nginx" ] || mkdir -p "${WEBTPL}/nginx"
4031

41-
# Update Multi-PHP templates
42-
php_versions=$(ls /etc/php/*/fpm -d 2>/dev/null | wc -l)
43-
if [ "$php_versions" -gt 1 ] && [ -z "$WEB_BACKEND" ]; then
44-
for v in $(ls /etc/php/); do
45-
if [ ! -d "/etc/php/$v/fpm/pool.d/" ]; then
46-
continue
47-
fi
48-
v_tpl=$(echo "$v" | sed -e 's/[.]//')
49-
cp -f "$HESTIA_INSTALL_DIR/multiphp/${WEB_SYSTEM}/PHP-${v_tpl}".* "${WEBTPL}/${WEB_SYSTEM}/"
50-
done
51-
chmod a+x "${WEBTPL}/${WEB_SYSTEM}/"*.sh 2> /dev/null
52-
53-
# Create default TPL symlink when missing and point to the last php version found
54-
if [ ! -z $v_tpl ] && [ "$WEB_SYSTEM" = "nginx" ]; then
55-
[ -e "${WEBTPL}/${WEB_SYSTEM}/default.sh" ] || ln -s "${WEBTPL}/${WEB_SYSTEM}/PHP-${v_tpl}.sh" "${WEBTPL}/${WEB_SYSTEM}/default.sh"
56-
[ -e "${WEBTPL}/${WEB_SYSTEM}/default.tpl" ] || ln -s "${WEBTPL}/${WEB_SYSTEM}/PHP-${v_tpl}.tpl" "${WEBTPL}/${WEB_SYSTEM}/default.tpl"
57-
[ -e "${WEBTPL}/${WEB_SYSTEM}/default.stpl" ] || ln -s "${WEBTPL}/${WEB_SYSTEM}/PHP-${v_tpl}.stpl" "${WEBTPL}/${WEB_SYSTEM}/default.stpl"
58-
fi
59-
fi
60-
6132
if [ "$PROXY_SYSTEM" = 'nginx' ] || [ "$WEB_BACKEND" = "php-fpm" ]; then
6233
cp -rf "${HESTIA_INSTALL_DIR}/templates/web/nginx" "${WEBTPL}/"
6334
fi
6435

36+
for webtpl_folder in $(ls $HESTIA_INSTALL_DIR/templates/web/* -d 2>/dev/null | egrep -v '/(nginx)$' ); do
37+
cp -rf "${webtpl_folder}" "${WEBTPL}/"
38+
done
39+
40+
for php_ver in $(ls /etc/php/); do
41+
[ ! -d "/etc/php/$php_ver/fpm/pool.d/" ] && continue
42+
cp -f "$HESTIA_INSTALL_DIR/php-fpm/multiphp.tpl" ${WEBTPL}/php-fpm/PHP-${php_ver/\./_}.tpl
43+
done
44+
6545
# Rebuilding web domains
6646
for user in $($BIN/v-list-sys-users plain); do
6747
$BIN/v-rebuild-web-domains $user no

0 commit comments

Comments
 (0)