mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-25 06:10:20 +00:00
Temporarily get rid of gateway sourcing from setupVars, temporarily.
This commit is contained in:
parent
fb70fd77e8
commit
b0874fb23a
1 changed files with 26 additions and 28 deletions
|
@ -65,43 +65,41 @@ version_check() {
|
||||||
header_write "Installed Package Versions"
|
header_write "Installed Package Versions"
|
||||||
echo "::: Detecting Pi-hole installed versions."
|
echo "::: Detecting Pi-hole installed versions."
|
||||||
|
|
||||||
pi_hole_ver="$(cd /etc/.pihole/ && git describe --tags --abbrev=0)" \
|
local pi_hole_ver="$(cd /etc/.pihole/ && git describe --tags --abbrev=0)" \
|
||||||
&& log_echo "Pi-hole: $pi_hole_ver" || log_echo "Pi-hole git repository not detected."
|
&& log_echo "Pi-hole: $pi_hole_ver" || log_echo "Pi-hole git repository not detected."
|
||||||
admin_ver="$(cd /var/www/html/admin && git describe --tags --abbrev=0)" \
|
local admin_ver="$(cd /var/www/html/admin && git describe --tags --abbrev=0)" \
|
||||||
&& log_echo "WebUI: $admin_ver" || log_echo "Pi-hole Admin Pages git repository not detected."
|
&& log_echo "WebUI: $admin_ver" || log_echo "Pi-hole Admin Pages git repository not detected."
|
||||||
light_ver="$(lighttpd -v |& head -n1 | cut -d " " -f1)" \
|
local light_ver="$(lighttpd -v |& head -n1 | cut -d " " -f1)" \
|
||||||
&& log_echo "${light_ver}" || log_echo "lighttpd not installed."
|
&& log_echo "${light_ver}" || log_echo "lighttpd not installed."
|
||||||
php_ver="$(php -v |& head -n1)" \
|
local php_ver="$(php -v |& head -n1)" \
|
||||||
&& log_echo "${php_ver}" || log_echo "PHP not installed."
|
&& log_echo "${php_ver}" || log_echo "PHP not installed."
|
||||||
echo ":::"
|
echo ":::"
|
||||||
}
|
}
|
||||||
|
|
||||||
files_check() {
|
source_variable() {
|
||||||
header_write "Files Check"
|
# Source file passed in as ${1} and add variable at ${2} to environment
|
||||||
|
source ${1}
|
||||||
|
echo $piholeInterface
|
||||||
|
}
|
||||||
|
|
||||||
#Check existence of setupVars.conf, and source it to get configured network interface for later use in script.
|
files_check() {
|
||||||
echo -n "::: Detecting existence setupVars.conf..."
|
header_write "File Check"
|
||||||
setupVars=/etc/pihole/setupVars.conf
|
|
||||||
if [[ -f ${setupVars} ]];then
|
#Check non-zero length existence of ${1}
|
||||||
echo " found!"
|
echo "::: Detecting existence of ${1}..."
|
||||||
log_write "/etc/pihole/setupVars.conf exists! Contents:"
|
local searchFile=/etc/pihole/"${1}"
|
||||||
|
if [[ -s ${searchFile} ]]; then
|
||||||
|
log_echo "/etc/pihole/${1} exists!"
|
||||||
while read -r line; do
|
while read -r line; do
|
||||||
if [ ! -z "${line}" ]; then
|
if [ ! -z "${line}" ]; then
|
||||||
[[ "${line}" =~ ^#.*$ ]] && continue
|
[[ "${line}" =~ ^#.*$ ]] && continue
|
||||||
log_write "${line}"
|
log_write "${line}"
|
||||||
fi
|
fi
|
||||||
done < "${setupVars}"
|
done < "${searchFile}"
|
||||||
log_write ""
|
|
||||||
|
|
||||||
. "${setupVars}"
|
|
||||||
if [[ -n "${piholeInterface}" ]]; then
|
|
||||||
# prepend % to the beginning of piholeInterface for later use
|
|
||||||
piholeInterface="%${piholeInterface}"
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
echo " NOT FOUND!"
|
log_echo "/etc/pihole/${1} not found!"
|
||||||
log_write "/etc/pihole/setupVars.conf not found!"
|
|
||||||
fi
|
fi
|
||||||
|
echo ":::"
|
||||||
}
|
}
|
||||||
|
|
||||||
distro_check() {
|
distro_check() {
|
||||||
|
@ -309,7 +307,7 @@ debugLighttpd() {
|
||||||
### END FUNCTIONS ###
|
### END FUNCTIONS ###
|
||||||
|
|
||||||
version_check
|
version_check
|
||||||
files_check
|
files_check "setupVars.conf"
|
||||||
distro_check
|
distro_check
|
||||||
ip_check
|
ip_check
|
||||||
hostnameCheck
|
hostnameCheck
|
||||||
|
|
Loading…
Reference in a new issue