From 01a9ed04b172b1a466a5a2e5e86b718723df776b Mon Sep 17 00:00:00 2001 From: Patrick McGuire <60325264+mcguirepr89@users.noreply.github.com> Date: Sat, 8 Jan 2022 07:37:33 -0500 Subject: [PATCH] Fixed PHP version installer OLD php_version="$(awk -F. '{print $2}' <(ls -l $(which /etc/alternatives/php)))" NEW php_version="$(awk -F'php' '{print $3}' <(ls -l $(which /etc/alternatives/php)))" --- scripts/update_services.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/update_services.sh b/scripts/update_services.sh index fe66abd..5fbf27c 100755 --- a/scripts/update_services.sh +++ b/scripts/update_services.sh @@ -228,7 +228,7 @@ install_Caddyfile() { if [ -f /etc/caddy/Caddyfile ];then cp /etc/caddy/Caddyfile{,.original} fi - php_version="$(awk -F. '{print $2}' <(ls -l $(which /etc/alternatives/php)))" + php_version="$(awk -F'php' '{print $3}' <(ls -l $(which /etc/alternatives/php)))" HASHWORD=$(caddy hash-password -plaintext ${CADDY_PWD}) cat << EOF > /etc/caddy/Caddyfile http://localhost http://birdnetpi.local ${BIRDNETPI_URL} { @@ -247,7 +247,7 @@ http://localhost http://birdnetpi.local ${BIRDNETPI_URL} { birdnet ${HASHWORD} } reverse_proxy /stream localhost:8000 - php_fastcgi unix//run/php/php7.${php_version}-fpm.sock + php_fastcgi unix//run/php/php${php_version}-fpm.sock } EOF if [ ! -z ${EXTRACTIONLOG_URL} ];then @@ -539,7 +539,7 @@ install_selected_services() { create_necessary_dirs generate_BirdDB install_cleanup_cron - systemctl restart php7.${php_version}-fpm + systemctl restart php${php_version}-fpm } if [ -f ${config_file} ];then