From f0f4f16438cd66b340f37fa7be0423ec51cc148c Mon Sep 17 00:00:00 2001 From: Joseph Haig Date: Sat, 28 Oct 2017 12:00:15 +0000 Subject: [PATCH 1/2] Fix fastcgi-php setup for fresh install --- installers/common.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/installers/common.sh b/installers/common.sh index f1eb7004..09661fda 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -73,7 +73,13 @@ function enable_php_lighttpd() { install_log "Enabling PHP for lighttpd" sudo lighty-enable-mod fastcgi-php - if [ $? -eq 2 ]; then echo already enabled; else install_error "Cannot enable fastcgi-php for lighttpd"; fi + if [ $? -eq 2 ] + then + echo ' [already enabled]' + elif [ $? -ne 0 ] + then + install_error "Cannot enable fastcgi-php for lighttpd" + fi sudo /etc/init.d/lighttpd restart || install_error "Unable to restart lighttpd" } From c8f863aeaf1cf1906293dace1274aaea16e57964 Mon Sep 17 00:00:00 2001 From: Joseph Haig Date: Sat, 28 Oct 2017 20:59:17 +0100 Subject: [PATCH 2/2] Fix properly --- installers/common.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/installers/common.sh b/installers/common.sh index 09661fda..9ac4046f 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -73,10 +73,11 @@ function enable_php_lighttpd() { install_log "Enabling PHP for lighttpd" sudo lighty-enable-mod fastcgi-php - if [ $? -eq 2 ] + ERR=$? + if [ $ERR -eq 2 ] then echo ' [already enabled]' - elif [ $? -ne 0 ] + elif [ $ERR -ne 0 ] then install_error "Cannot enable fastcgi-php for lighttpd" fi