From 8e860d27a2cf4cf0f477e42975c75cf4bc0849b2 Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Wed, 10 Nov 2021 13:15:44 -0500 Subject: [PATCH] install php before caddy now to determine php version --- scripts/install_services.sh | 3 ++- scripts/update_services.sh | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/install_services.sh b/scripts/install_services.sh index 7d7609e..6977034 100755 --- a/scripts/install_services.sh +++ b/scripts/install_services.sh @@ -211,6 +211,7 @@ install_Caddyfile() { fi HASHWORD=$(caddy hash-password -plaintext ${CADDY_PWD}) php_version="$(awk -F. '{print $2}' <(ls -l $(which /etc/alternatives/php)))" + echo "php_version=${php_version}" cat << EOF > /etc/caddy/Caddyfile http://localhost http://birdnetpi.local ${BIRDNETPI_URL} { root * ${EXTRACTED} @@ -478,6 +479,7 @@ install_selected_services() { install_recording_service fi + install_php install_caddy install_Caddyfile update_etc_hosts @@ -485,7 +487,6 @@ install_selected_services() { install_gotty_logs install_sox install_mariadb - install_php install_spectrogram_service install_edit_birdnet_conf install_pushed_notifications diff --git a/scripts/update_services.sh b/scripts/update_services.sh index 48695b3..e9698ae 100755 --- a/scripts/update_services.sh +++ b/scripts/update_services.sh @@ -350,15 +350,15 @@ install_sox() { } install_php() { - if ! which php &> /dev/null || ! which php-fpm7.3 || ! apt list --installed | grep php-xml;then + if ! which php &> /dev/null || ! which php-fpm || ! apt list --installed | grep php-xml;then echo "Installing PHP modules" apt -qq update - apt install -qqy php php-fpm php7.3-mysql php-xml + apt install -qqy php php-fpm php-mysql php-xml else echo "PHP and PHP-FPM installed" fi echo "Configuring PHP for Caddy" - sed -i 's/www-data/caddy/g' /etc/php/7.3/fpm/pool.d/www.conf + sed -i 's/www-data/caddy/g' /etc/php/*/fpm/pool.d/www.conf echo "Adding Caddy sudoers rule" cat << EOF > /etc/sudoers.d/010_caddy-nopasswd caddy ALL=(ALL) NOPASSWD: ALL @@ -474,6 +474,7 @@ install_selected_services() { install_recording_service fi + install_php install_caddy install_Caddyfile update_etc_hosts @@ -481,7 +482,6 @@ install_selected_services() { install_gotty_logs install_sox install_mariadb - install_php install_spectrogram_service install_edit_birdnet_conf install_pushed_notifications