mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-03-03 15:28:28 +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}")
|
||||
if [[ "${file_found}" ]]; then
|
||||
# shellcheck source=/dev/null
|
||||
(source "${1}" &> /dev/null && echo "${file_found} and was successfully sourced") \
|
||||
|| log_echo -l "${file_found} and could not be sourced"
|
||||
fi
|
||||
}
|
||||
|
||||
distro_check() {
|
||||
header_write "Detecting installed OS distribution:"
|
||||
local soft_fail
|
||||
header_write "Detecting installed OS Distribution"
|
||||
local distro
|
||||
|
||||
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}"
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue