1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-11-19 14:48:13 +00:00

Shellchecking.

Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
This commit is contained in:
Dan Schaper 2017-03-04 19:05:32 -08:00
parent dc44fc9e27
commit 512c650441
No known key found for this signature in database
GPG Key ID: 572E999E385B7BFC

View File

@ -121,28 +121,41 @@ version_check() {
local admin_commit local admin_commit
local light_ver local light_ver
local php_ver local php_ver
local status
error_found=0 error_found=0
if [[ -d "${PIHOLEGITDIR}" ]]; then cd "${PIHOLEGITDIR}" &> /dev/null || \
cd "${PIHOLEGITDIR}" { status="Pi-hole git directory not found."; error_found=1; }
pi_hole_ver=$(git describe --tags --abbrev=0) if git status &> /dev/null; then
pi_hole_branch=$(git rev-parse --abbrev-ref HEAD) pi_hole_ver=$(git describe --tags --abbrev=0)
pi_hole_commit=$(git describe --long --dirty --tags --always) pi_hole_branch=$(git rev-parse --abbrev-ref HEAD)
log_echo -r "Pi-hole: ${pi_hole_ver:-Untagged} (${pi_hole_branch:-Detached}:${pi_hole_commit})" pi_hole_commit=$(git describe --long --dirty --tags --always)
else log_echo -r "Pi-hole: ${pi_hole_ver:-Untagged} (${pi_hole_branch:-Detached}:${pi_hole_commit})"
log_echo "Pi-hole git repository not detected." else
error_found=1 status=${status:-"Pi-hole repository damaged."}
fi error_found=1
if [[ -d "${ADMINGITDIR}" ]]; then fi
cd "${ADMINGITDIR}" if [[ "${status}" ]]; then
admin_ver=$(git describe --tags --abbrev=0) log_echo "${status}"
admin_branch=$(git rev-parse --abbrev-ref HEAD) unset status
admin_commit=$(git describe --long --dirty --tags --always) fi
log_echo -r "Web Dashboard: ${admin_ver:-Untagged} (${admin_branch:-Detached}:${admin_commit})"
else cd "${ADMINGITDIR}" || \
log_echo "Pi-hole Admin Pages git repository not detected." { status="Pi-hole Dashboard git directory not found."; error_found=1; }
error_found=1 if git status &> /dev/null; then
fi admin_ver=$(git describe --tags --abbrev=0)
admin_branch=$(git rev-parse --abbrev-ref HEAD)
admin_commit=$(git describe --long --dirty --tags --always)
log_echo -r "Pi-hole Dashboard: ${admin_ver:-Untagged} (${admin_branch:-Detached}:${admin_commit})"
else
status=${status:-"Pi-hole Dashboard repository damaged."}
error_found=1
fi
if [[ "${status}" ]]; then
log_echo "${status}"
unset status
fi
if light_ver=$(lighttpd -v |& head -n1 | cut -d " " -f1); then if light_ver=$(lighttpd -v |& head -n1 | cut -d " " -f1); then
log_echo -r "${light_ver}" log_echo -r "${light_ver}"
else else