forked from hestiacp/hestiacp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupgrade_multi_php.sh
More file actions
executable file
·26 lines (22 loc) · 901 Bytes
/
upgrade_multi_php.sh
File metadata and controls
executable file
·26 lines (22 loc) · 901 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
# Update www.conf to a different version so users can safely delete older php version.
# www.conf is used for Roundcube, Rainloop, SnappyMail and phpmyadmin
# Removal of the "www.conf" php version will cause issues with Rainloop not working. Current script updates it to the latest version of PHP installed. If that is not wanted use this script
version=$1
if [ ! -x "$(command -v php)" ]; then
echo "PHP is not installed. Aborting."
exit 1
fi
# Verify php version format
if [[ ! $version =~ ^[0-9]\.[0-9]+ ]]; then
echo "The PHP version format is invalid, it should look like [0-9].[0-9]."
echo "Example: 7.0, 7.4"
exit
fi
if [ ! -f /etc/php/$version/fpm/pool.d/dummy.conf ]; then
echo "PHP versions doesn't exists"
exit
fi
rm -f /etc/php/*/fpm/pool.d/www.conf
cp -f $HESTIA/install/deb/php-fpm/www.conf /etc/php/$version/fpm/pool.d/www.conf
$HESTIA/bin/v-restart-web-backend