mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-03-03 23:38:29 +00:00
Shellcheck distro check
This commit is contained in:
parent
e2037819ac
commit
b98737cd93
1 changed files with 11 additions and 2 deletions
|
@ -159,16 +159,25 @@ source_file() {
|
||||||
|
|
||||||
file_found=$(files_check "${1}")
|
file_found=$(files_check "${1}")
|
||||||
if [[ "${file_found}" ]]; then
|
if [[ "${file_found}" ]]; then
|
||||||
|
# shellcheck source=/dev/null
|
||||||
(source "${1}" &> /dev/null && echo "${file_found} and was successfully sourced") \
|
(source "${1}" &> /dev/null && echo "${file_found} and was successfully sourced") \
|
||||||
|| log_echo -l "${file_found} and could not be sourced"
|
|| log_echo -l "${file_found} and could not be sourced"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
distro_check() {
|
distro_check() {
|
||||||
|
header_write "Detecting installed OS distribution:"
|
||||||
local soft_fail
|
local soft_fail
|
||||||
header_write "Detecting installed OS Distribution"
|
local distro
|
||||||
|
|
||||||
soft_fail=0
|
soft_fail=0
|
||||||
local distro="$(cat /etc/*release)" && block_parse "${distro}" || (log_echo "Distribution details not found." && soft_fail=1)
|
distro="$(cat /etc/*release)"
|
||||||
|
if [[ "${distro}" ]]; then
|
||||||
|
block_parse "${distro}"
|
||||||
|
else
|
||||||
|
log_echo "Distribution details not found."
|
||||||
|
soft_fail=1
|
||||||
|
fi
|
||||||
return "${soft_fail}"
|
return "${soft_fail}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue