Skip to content

Commit b52bbf2

Browse files
committed
better detection of multiphp when updating web templates and running hestia upgrade script
1 parent 2f4be56 commit b52bbf2

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

bin/v-update-web-templates

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,17 @@ fi
4141
cp -rf $HESTIA/install/$type/templates/web $HESTIA/data/templates/
4242

4343
# Update Multiphp templates
44-
php_versions=$( ls -l /etc/php/ | grep ^d | wc -l )
44+
php_versions=$(ls /etc/php/*/fpm -d | wc -l)
4545
if [ "$php_versions" -gt 1 ]; then
4646
if [ "$WEB_SYSTEM" = "nginx" ]; then
4747
for tplname in $(ls $HESTIA/data/templates/web/$WEB_SYSTEM/ | grep -v 'default'); do
4848
rm -fr $HESTIA/data/templates/web/$WEB_SYSTEM/$tplname
4949
done
5050
fi
5151
for v in $(ls /etc/php/); do
52+
if [ ! -d "/etc/php/$v/fpm/pool.d/" ]; then
53+
continue
54+
fi
5255
v_tpl=$(echo "$v" | sed -e 's/[.]//')
5356
cp -f $HESTIA/install/$type/multiphp/$WEB_SYSTEM/PHP-$v_tpl.* $HESTIA/data/templates/web/$WEB_SYSTEM/
5457
done

install/upgrade/0.10.0-190430.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,13 @@ chmod 751 $HESTIA/data/templates/web/unassigned/js
145145
chmod 751 $HESTIA/data/templates/web/unassigned/webfonts
146146

147147
# Correct other permissions
148-
chown bind:bind /var/cache/bind
149-
chmod 640 /etc/roundcube/debian-db*
150-
chown root:www-data /etc/roundcube/debian-db*
148+
if [ -d "/var/cache/bind" ]; then
149+
chown bind:bind /var/cache/bind
150+
fi
151+
if [ -d "/etc/roundcube" ]; then
152+
chmod 640 /etc/roundcube/debian-db*
153+
chown root:www-data /etc/roundcube/debian-db*
154+
fi
151155

152156
# Add unassigned hosts configuration to Nginx and Apache
153157
if [ "$WEB_SYSTEM" = "apache2" ]; then
@@ -174,9 +178,12 @@ if [ "$PROXY_SYSTEM" = "nginx" ]; then
174178
fi
175179

176180
# Fix empty pool error message for MultiPHP
177-
php_versions=$( ls -l /etc/php/ | grep ^d | wc -l )
181+
php_versions=$(ls /etc/php/*/fpm -d | wc -l)
178182
if [ "$php_versions" -gt 1 ]; then
179183
for v in $(ls /etc/php/); do
184+
if [ ! -d "/etc/php/$v/fpm/pool.d/" ]; then
185+
continue
186+
fi
180187
cp -f $hestiacp/php-fpm/dummy.conf /etc/php/$v/fpm/pool.d/
181188
v1=$(echo "$v" | sed -e 's/[.]//')
182189
sed -i "s/9999/99$v1/g" /etc/php/$v/fpm/pool.d/dummy.conf

0 commit comments

Comments
 (0)