upgrade_multi_php.sh 901 B

1234567891011121314151617181920212223242526
  1. #!/bin/bash
  2. # Update www.conf to a different version so users can safely delete older php version.
  3. # www.conf is used for Roundcube, Rainloop, SnappyMail and phpmyadmin
  4. # 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
  5. version=$1
  6. if [ ! -x "$(command -v php)" ]; then
  7. echo "PHP is not installed. Aborting."
  8. exit 1
  9. fi
  10. # Verify php version format
  11. if [[ ! $version =~ ^[0-9]\.[0-9]+ ]]; then
  12. echo "The PHP version format is invalid, it should look like [0-9].[0-9]."
  13. echo "Example: 7.0, 7.4"
  14. exit
  15. fi
  16. if [ ! -f /etc/php/$version/fpm/pool.d/dummy.conf ]; then
  17. echo "PHP versions doesn't exists"
  18. exit
  19. fi
  20. rm -f /etc/php/*/fpm/pool.d/www.conf
  21. cp -f $HESTIA/install/deb/php-fpm/www.conf /etc/php/$version/fpm/pool.d/www.conf
  22. $HESTIA/bin/v-restart-web-backend