mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-25 06:10:20 +00:00
disable 2016 in two places and declare local variables
Signed-off-by: Adam Warner <adamw@rner.email>
This commit is contained in:
parent
b57b3f4588
commit
e6fc9dc75d
1 changed files with 7 additions and 2 deletions
|
@ -245,6 +245,7 @@ compare_local_version_to_git_version() {
|
||||||
local search_term="Pi-hole"
|
local search_term="Pi-hole"
|
||||||
elif [[ "${pihole_component}" == "Web" ]]; then
|
elif [[ "${pihole_component}" == "Web" ]]; then
|
||||||
# We need to search for "AdminLTE" so store it in a variable as well
|
# We need to search for "AdminLTE" so store it in a variable as well
|
||||||
|
#shellcheck disable=2034
|
||||||
local search_term="AdminLTE"
|
local search_term="AdminLTE"
|
||||||
fi
|
fi
|
||||||
# Display what we are checking
|
# Display what we are checking
|
||||||
|
@ -385,6 +386,8 @@ get_distro_attributes() {
|
||||||
OLD_IFS="$IFS"
|
OLD_IFS="$IFS"
|
||||||
# Store the distro info in an array and make it global since the OS won't change,
|
# Store the distro info in an array and make it global since the OS won't change,
|
||||||
# but we'll keep it within the function for better unit testing
|
# but we'll keep it within the function for better unit testing
|
||||||
|
local distro_info
|
||||||
|
#shellcheck disable=SC2016
|
||||||
IFS=$'\r\n' command eval 'distro_info=( $(cat /etc/*release) )'
|
IFS=$'\r\n' command eval 'distro_info=( $(cat /etc/*release) )'
|
||||||
|
|
||||||
# Set a named variable for better readability
|
# Set a named variable for better readability
|
||||||
|
@ -754,14 +757,14 @@ dig_at() {
|
||||||
if [[ ${protocol} == "6" ]]; then
|
if [[ ${protocol} == "6" ]]; then
|
||||||
# Set the IPv6 variables and record type
|
# Set the IPv6 variables and record type
|
||||||
local local_address="::1"
|
local local_address="::1"
|
||||||
local pihole_address="${IPV6_ADDRESS%/*}"
|
local pihole_address="${IP}"
|
||||||
local remote_address="2001:4860:4860::8888"
|
local remote_address="2001:4860:4860::8888"
|
||||||
local record_type="AAAA"
|
local record_type="AAAA"
|
||||||
# Othwerwise, it should be 4
|
# Othwerwise, it should be 4
|
||||||
else
|
else
|
||||||
# so use the IPv4 values
|
# so use the IPv4 values
|
||||||
local local_address="127.0.0.1"
|
local local_address="127.0.0.1"
|
||||||
local pihole_address="${IPV4_ADDRESS%/*}"
|
local pihole_address="${IP}"
|
||||||
local remote_address="8.8.8.8"
|
local remote_address="8.8.8.8"
|
||||||
local record_type="A"
|
local record_type="A"
|
||||||
fi
|
fi
|
||||||
|
@ -885,6 +888,8 @@ parse_file() {
|
||||||
# Put the current Internal Field Separator into another variable so it can be restored later
|
# Put the current Internal Field Separator into another variable so it can be restored later
|
||||||
OLD_IFS="$IFS"
|
OLD_IFS="$IFS"
|
||||||
# Get the lines that are in the file(s) and store them in an array for parsing later
|
# Get the lines that are in the file(s) and store them in an array for parsing later
|
||||||
|
local file_info
|
||||||
|
#shellcheck disable=SC2016
|
||||||
IFS=$'\r\n' command eval 'file_info=( $(cat "${filename}") )'
|
IFS=$'\r\n' command eval 'file_info=( $(cat "${filename}") )'
|
||||||
|
|
||||||
# Set a named variable for better readability
|
# Set a named variable for better readability
|
||||||
|
|
Loading…
Reference in a new issue