Skip to content

Commit 167b7a4

Browse files
author
Kristan Kenney
committed
Improve Multi-PHP detection
1 parent d7f2dee commit 167b7a4

File tree

2 files changed

+29
-24
lines changed

2 files changed

+29
-24
lines changed

bin/v-update-web-templates

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,24 @@ fi
4040
# Update templates
4141
cp -rf $HESTIA/install/$type/templates/web $HESTIA/data/templates/
4242

43-
# Update Multiphp templates
44-
php_versions=$(ls /etc/php/*/fpm -d | wc -l)
45-
if [ "$php_versions" -gt 1 ]; then
46-
if [ "$WEB_SYSTEM" = "nginx" ]; then
47-
for tplname in $(ls $HESTIA/data/templates/web/$WEB_SYSTEM/ | grep -v 'default'); do
48-
rm -fr $HESTIA/data/templates/web/$WEB_SYSTEM/$tplname
43+
# Update Multi-PHP templates
44+
if [ -d "/etc/php/*/fpm" ]; then
45+
php_versions=$(ls /etc/php/*/fpm -d | wc -l)
46+
if [ "$php_versions" -gt 1 ]; then
47+
if [ "$WEB_SYSTEM" = "nginx" ]; then
48+
for tplname in $(ls $HESTIA/data/templates/web/$WEB_SYSTEM/ | grep -v 'default'); do
49+
rm -fr $HESTIA/data/templates/web/$WEB_SYSTEM/$tplname
50+
done
51+
fi
52+
for v in $(ls /etc/php/); do
53+
if [ ! -d "/etc/php/$v/fpm/pool.d/" ]; then
54+
continue
55+
fi
56+
v_tpl=$(echo "$v" | sed -e 's/[.]//')
57+
cp -f $HESTIA/install/$type/multiphp/$WEB_SYSTEM/PHP-$v_tpl.* $HESTIA/data/templates/web/$WEB_SYSTEM/
4958
done
59+
chmod a+x $HESTIA/data/templates/web/$WEB_SYSTEM/*.sh
5060
fi
51-
for v in $(ls /etc/php/); do
52-
if [ ! -d "/etc/php/$v/fpm/pool.d/" ]; then
53-
continue
54-
fi
55-
v_tpl=$(echo "$v" | sed -e 's/[.]//')
56-
cp -f $HESTIA/install/$type/multiphp/$WEB_SYSTEM/PHP-$v_tpl.* $HESTIA/data/templates/web/$WEB_SYSTEM/
57-
done
58-
chmod a+x $HESTIA/data/templates/web/$WEB_SYSTEM/*.sh
5961
fi
6062

6163
# Rebuilding web domains

install/upgrade/0.10.0-190430.sh

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -174,16 +174,19 @@ if [ "$PROXY_SYSTEM" = "nginx" ]; then
174174
fi
175175

176176
# Fix empty pool error message for MultiPHP
177-
php_versions=$(ls /etc/php/*/fpm -d | wc -l)
178-
if [ "$php_versions" -gt 1 ]; then
179-
for v in $(ls /etc/php/); do
180-
if [ ! -d "/etc/php/$v/fpm/pool.d/" ]; then
181-
continue
182-
fi
183-
cp -f $hestiacp/php-fpm/dummy.conf /etc/php/$v/fpm/pool.d/
184-
v1=$(echo "$v" | sed -e 's/[.]//')
185-
sed -i "s/9999/99$v1/g" /etc/php/$v/fpm/pool.d/dummy.conf
186-
done
177+
if [ -d "/etc/php/*/fpm" ]; then
178+
php_versions=$(ls /etc/php/*/fpm -d | wc -l)
179+
if [ "$php_versions" -gt 1 ]; then
180+
for v in $(ls /etc/php/); do
181+
if [ ! -d "/etc/php/$v/fpm/pool.d/" ]; then
182+
continue
183+
fi
184+
echo "(*) Updating Multi-PHP configuration..."
185+
cp -f $hestiacp/php-fpm/dummy.conf /etc/php/$v/fpm/pool.d/
186+
v1=$(echo "$v" | sed -e 's/[.]//')
187+
sed -i "s/9999/99$v1/g" /etc/php/$v/fpm/pool.d/dummy.conf
188+
done
189+
fi
187190
fi
188191

189192
# Set Purge to false in Roundcube configuration - https://goo.gl/3Nja3u

0 commit comments

Comments
 (0)