diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 4ab5c0e2..10b5a390 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -2,7 +2,7 @@ # shellcheck disable=SC1090 # Pi-hole: A black hole for Internet advertisements -# (c) 2017-2018 Pi-hole, LLC (https://pi-hole.net) +# (c) 2017-2021 Pi-hole, LLC (https://pi-hole.net) # Network-wide ad blocking via your own hardware. # # Installs and Updates Pi-hole @@ -186,7 +186,7 @@ os_check() { local remote_os_domain valid_os valid_version valid_response detected_os detected_version display_warning cmdResult digReturnCode response remote_os_domain="versions.pi-hole.net" - detected_os=$(grep "\bID\b" /etc/os-release | cut -d '=' -f2 | tr -d '"') + detected_os=$(grep "\\bID\\b" /etc/os-release | cut -d '=' -f2 | tr -d '"') detected_version=$(grep VERSION_ID /etc/os-release | cut -d '=' -f2 | tr -d '"') cmdResult="$(dig +short -t txt ${remote_os_domain} @ns1.pi-hole.net 2>&1; echo $?)" @@ -1020,7 +1020,7 @@ valid_ip() { # optional port number starting '#' with range of 1-65536 local portelem="(#([1-9]|[1-8][0-9]|9[0-9]|[1-8][0-9]{2}|9[0-8][0-9]|99[0-9]|[1-8][0-9]{3}|9[0-8][0-9]{2}|99[0-8][0-9]|999[0-9]|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-6]))?" # build a full regex string from the above parts - local regex="^${ipv4elem}\.${ipv4elem}\.${ipv4elem}\.${ipv4elem}${portelem}$" + local regex="^${ipv4elem}\\.${ipv4elem}\\.${ipv4elem}\\.${ipv4elem}${portelem}$" [[ $ip =~ ${regex} ]] @@ -2057,7 +2057,7 @@ checkSelinux() { local CURRENT_SELINUX local SELINUX_ENFORCING=0 # Check for SELinux configuration file and getenforce command - if [[ -f /etc/selinux/config ]] && command -v getenforce &> /dev/null; then + if [[ -f /etc/selinux/config ]] && is_command getenforce; then # Check the default SELinux mode DEFAULT_SELINUX=$(awk -F= '/^SELINUX=/ {print $2}' /etc/selinux/config) case "${DEFAULT_SELINUX,,}" in @@ -2293,7 +2293,6 @@ clone_or_update_repos() { FTLinstall() { # Local, named variables - local latesttag local str="Downloading and Installing FTL" printf " %b %s..." "${INFO}" "${str}" @@ -2368,7 +2367,7 @@ FTLinstall() { disable_dnsmasq() { # dnsmasq can now be stopped and disabled if it exists - if which dnsmasq &> /dev/null; then + if is_command dnsmasq; then if check_service_active "dnsmasq";then printf " %b FTL can now resolve DNS Queries without dnsmasq running separately\\n" "${INFO}" stop_service dnsmasq @@ -2501,7 +2500,7 @@ FTLcheckUpdate() { local localSha1 # if dnsmasq exists and is running at this point, force reinstall of FTL Binary - if which dnsmasq &> /dev/null; then + if is_command dnsmasq; then if check_service_active "dnsmasq";then return 0 fi