From 3b54cab3bcb6198ecff568a5823429efa36d648f Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sun, 8 Jan 2017 11:17:25 +0100 Subject: [PATCH 1/4] Show branches and revisions (incl. possible dirty state) in debug log --- advanced/Scripts/piholeDebug.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index d0e60177..999948c7 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -122,6 +122,13 @@ version_check() { && log_echo -r "${light_ver}" || (log_echo "lighttpd not installed." && error_found=1) local php_ver="$(php -v |& head -n1)" \ && log_echo -r "${php_ver}" || (log_echo "PHP not installed." && error_found=1) + + local pi_hole_branch="$(cd /etc/.pihole/ && git rev-parse --abbrev-ref HEAD)" && log_echo -r "Pi-hole branch: ${pi_hole_branch}" || log_echo "Unable to obtain Pi-hole branch" + local pi_hole_rev="$(cd /etc/.pihole/ && git describe --long --dirty --tags)" && log_echo -r "Pi-hole rev: ${pi_hole_rev}" || log_echo "Unable to obtain Pi-hole revision" + + local admin_branch="$(cd /var/www/html/admin && git rev-parse --abbrev-ref HEAD)" && log_echo -r "AminLTE branch: ${admin_branch}" || log_echo "Unable to obtain AminLTE branch" + local admin_rev="$(cd /var/www/html/admin && git describe --long --dirty --tags)" && log_echo -r "AminLTE rev: ${admin_rev}" || log_echo "Unable to obtain AminLTE revision" + return "${error_found}" } From 7d1f5091a7abb4e4124fe0422165c50e3875825c Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sun, 8 Jan 2017 11:21:10 +0100 Subject: [PATCH 2/4] Fixed small typo --- advanced/Scripts/piholeDebug.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index 999948c7..0258fbc6 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -126,8 +126,8 @@ version_check() { local pi_hole_branch="$(cd /etc/.pihole/ && git rev-parse --abbrev-ref HEAD)" && log_echo -r "Pi-hole branch: ${pi_hole_branch}" || log_echo "Unable to obtain Pi-hole branch" local pi_hole_rev="$(cd /etc/.pihole/ && git describe --long --dirty --tags)" && log_echo -r "Pi-hole rev: ${pi_hole_rev}" || log_echo "Unable to obtain Pi-hole revision" - local admin_branch="$(cd /var/www/html/admin && git rev-parse --abbrev-ref HEAD)" && log_echo -r "AminLTE branch: ${admin_branch}" || log_echo "Unable to obtain AminLTE branch" - local admin_rev="$(cd /var/www/html/admin && git describe --long --dirty --tags)" && log_echo -r "AminLTE rev: ${admin_rev}" || log_echo "Unable to obtain AminLTE revision" + local admin_branch="$(cd /var/www/html/admin && git rev-parse --abbrev-ref HEAD)" && log_echo -r "AdminLTE branch: ${admin_branch}" || log_echo "Unable to obtain AdminLTE branch" + local admin_rev="$(cd /var/www/html/admin && git describe --long --dirty --tags)" && log_echo -r "AdminLTE rev: ${admin_rev}" || log_echo "Unable to obtain AdminLTE revision" return "${error_found}" } From 63a414a544ffe6022c9d99f6226b92eea9f661fa Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sun, 8 Jan 2017 11:21:50 +0100 Subject: [PATCH 3/4] Align outputs --- advanced/Scripts/piholeDebug.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index 0258fbc6..43986351 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -123,8 +123,8 @@ version_check() { local php_ver="$(php -v |& head -n1)" \ && log_echo -r "${php_ver}" || (log_echo "PHP not installed." && error_found=1) - local pi_hole_branch="$(cd /etc/.pihole/ && git rev-parse --abbrev-ref HEAD)" && log_echo -r "Pi-hole branch: ${pi_hole_branch}" || log_echo "Unable to obtain Pi-hole branch" - local pi_hole_rev="$(cd /etc/.pihole/ && git describe --long --dirty --tags)" && log_echo -r "Pi-hole rev: ${pi_hole_rev}" || log_echo "Unable to obtain Pi-hole revision" + local pi_hole_branch="$(cd /etc/.pihole/ && git rev-parse --abbrev-ref HEAD)" && log_echo -r "Pi-hole branch: ${pi_hole_branch}" || log_echo "Unable to obtain Pi-hole branch" + local pi_hole_rev="$(cd /etc/.pihole/ && git describe --long --dirty --tags)" && log_echo -r "Pi-hole rev: ${pi_hole_rev}" || log_echo "Unable to obtain Pi-hole revision" local admin_branch="$(cd /var/www/html/admin && git rev-parse --abbrev-ref HEAD)" && log_echo -r "AdminLTE branch: ${admin_branch}" || log_echo "Unable to obtain AdminLTE branch" local admin_rev="$(cd /var/www/html/admin && git describe --long --dirty --tags)" && log_echo -r "AdminLTE rev: ${admin_rev}" || log_echo "Unable to obtain AdminLTE revision" From 74a4e62cc9dd09c8dc9c9d6069856f358503b4e7 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sun, 8 Jan 2017 11:26:56 +0100 Subject: [PATCH 4/4] Codacy fix --- advanced/Scripts/piholeDebug.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index 43986351..09d9a786 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -123,11 +123,11 @@ version_check() { local php_ver="$(php -v |& head -n1)" \ && log_echo -r "${php_ver}" || (log_echo "PHP not installed." && error_found=1) - local pi_hole_branch="$(cd /etc/.pihole/ && git rev-parse --abbrev-ref HEAD)" && log_echo -r "Pi-hole branch: ${pi_hole_branch}" || log_echo "Unable to obtain Pi-hole branch" - local pi_hole_rev="$(cd /etc/.pihole/ && git describe --long --dirty --tags)" && log_echo -r "Pi-hole rev: ${pi_hole_rev}" || log_echo "Unable to obtain Pi-hole revision" + (local pi_hole_branch="$(cd /etc/.pihole/ && git rev-parse --abbrev-ref HEAD)" && log_echo -r "Pi-hole branch: ${pi_hole_branch}") || log_echo "Unable to obtain Pi-hole branch" + (local pi_hole_rev="$(cd /etc/.pihole/ && git describe --long --dirty --tags)" && log_echo -r "Pi-hole rev: ${pi_hole_rev}") || log_echo "Unable to obtain Pi-hole revision" - local admin_branch="$(cd /var/www/html/admin && git rev-parse --abbrev-ref HEAD)" && log_echo -r "AdminLTE branch: ${admin_branch}" || log_echo "Unable to obtain AdminLTE branch" - local admin_rev="$(cd /var/www/html/admin && git describe --long --dirty --tags)" && log_echo -r "AdminLTE rev: ${admin_rev}" || log_echo "Unable to obtain AdminLTE revision" + (local admin_branch="$(cd /var/www/html/admin && git rev-parse --abbrev-ref HEAD)" && log_echo -r "AdminLTE branch: ${admin_branch}") || log_echo "Unable to obtain AdminLTE branch" + (local admin_rev="$(cd /var/www/html/admin && git describe --long --dirty --tags)" && log_echo -r "AdminLTE rev: ${admin_rev}") || log_echo "Unable to obtain AdminLTE revision" return "${error_found}" }