diff --git a/README.md b/README.md index 92b85906..67893ec7 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ Sending a donation using our links below is **extremely helpful** in offsetting If you'd rather not [donate](https://pi-hole.net/donate/) (_which is okay!_), there are other ways you can help support us: - [Patreon](https://patreon.com/pihole) _Become a patron for rewards_ - [Digital Ocean](http://www.digitalocean.com/?refcode=344d234950e1) _affiliate link_ -- [Stickermule](https://www.stickermule.com/unlock?ref_id=6055890701&utm_medium=link&utm_source=invite) _earn a $10 credit after your first purchase_ +- [Stickermule](https://www.stickermule.com/unlock?ref_id=9127301701&utm_medium=link&utm_source=invite) _earn a $10 credit after your first purchase_ - [Pi-hole Swag Store](https://pi-hole.net/shop/) _affiliate link_ - [Amazon](http://www.amazon.com/exec/obidos/redirect-home/pihole09-20) _affiliate link_ - [DNS Made Easy](https://cp.dnsmadeeasy.com/u/133706) _affiliate link_ diff --git a/advanced/Scripts/chronometer.sh b/advanced/Scripts/chronometer.sh index 7c2d8b52..1a4ce993 100755 --- a/advanced/Scripts/chronometer.sh +++ b/advanced/Scripts/chronometer.sh @@ -444,6 +444,9 @@ get_strings() { } chronoFunc() { + local extra_arg="$1" + local extra_value="$2" + get_init_stats for (( ; ; )); do @@ -461,10 +464,8 @@ chronoFunc() { fi # Get refresh number - if [[ "$*" == *"-r"* ]]; then - num="$*" - num="${num/*-r /}" - num="${num/ */}" + if [[ "${extra_arg}" = "refresh" ]]; then + num="${extra_value}" num_str="Refresh set for every $num seconds" else num_str="" @@ -473,7 +474,7 @@ chronoFunc() { clear # Remove exit message heading on third refresh - if [[ "$count" -le 2 ]] && [[ "$*" != *"-e"* ]]; then + if [[ "$count" -le 2 ]] && [[ "${extra_arg}" != "exit" ]]; then echo -e " ${COL_LIGHT_GREEN}Pi-hole Chronometer${COL_NC} $num_str ${COL_LIGHT_RED}Press Ctrl-C to exit${COL_NC} @@ -521,10 +522,10 @@ chronoFunc() { fi # Handle exit/refresh options - if [[ "$*" == *"-e"* ]]; then + if [[ "${extra_arg}" == "exit" ]]; then exit 0 else - if [[ "$*" == *"-r"* ]]; then + if [[ "${extra_arg}" == "refresh" ]]; then sleep "$num" else sleep 5 @@ -561,12 +562,10 @@ if [[ $# = 0 ]]; then chronoFunc fi -for var in "$@"; do - case "$var" in - "-j" | "--json" ) jsonFunc;; - "-h" | "--help" ) helpFunc;; - "-r" | "--refresh" ) chronoFunc "$@";; - "-e" | "--exit" ) chronoFunc "$@";; - * ) helpFunc "?";; - esac -done +case "$1" in + "-j" | "--json" ) jsonFunc;; + "-h" | "--help" ) helpFunc;; + "-r" | "--refresh" ) chronoFunc refresh "$2";; + "-e" | "--exit" ) chronoFunc exit;; + * ) helpFunc "?";; +esac diff --git a/advanced/Scripts/piholeCheckout.sh b/advanced/Scripts/piholeCheckout.sh index 13fa3402..673ded0b 100644 --- a/advanced/Scripts/piholeCheckout.sh +++ b/advanced/Scripts/piholeCheckout.sh @@ -117,7 +117,7 @@ checkout() { if [[ "${corebranches[*]}" == *"master"* ]]; then echo -e "${OVER} ${TICK} $str" - echo -e "${INFO} ${#corebranches[@]} branches available for Pi-hole Core" + echo -e " ${INFO} ${#corebranches[@]} branches available for Pi-hole Core" else # Print STDERR output from get_available_branches echo -e "${OVER} ${CROSS} $str\\n\\n${corebranches[*]}" @@ -144,7 +144,7 @@ checkout() { if [[ "${webbranches[*]}" == *"master"* ]]; then echo -e "${OVER} ${TICK} $str" - echo -e "${INFO} ${#webbranches[@]} branches available for Web Admin" + echo -e " ${INFO} ${#webbranches[@]} branches available for Web Admin" else # Print STDERR output from get_available_branches echo -e "${OVER} ${CROSS} $str\\n\\n${webbranches[*]}" diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index 591a7ae4..1010f26c 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -1180,7 +1180,7 @@ upload_to_tricorder() { # let the user know log_write "${INFO} Debug script running in automated mode" # and then decide again which tool to use to submit it - tricorder_use_nc_or_ssl + tricorder_use_nc_or_curl # If we're not running in automated mode, else echo "" @@ -1189,7 +1189,7 @@ upload_to_tricorder() { read -r -p "[?] Would you like to upload the log? [y/N] " response case ${response} in # If they say yes, run our function for uploading the log - [yY][eE][sS]|[yY]) tricorder_use_nc_or_ssl;; + [yY][eE][sS]|[yY]) tricorder_use_nc_or_curl;; # If they choose no, just exit out of the script *) log_write " * Log will ${COL_GREEN}NOT${COL_NC} be uploaded to tricorder.";exit; esac diff --git a/advanced/Scripts/updatecheck.sh b/advanced/Scripts/updatecheck.sh index 972ab585..afb03ebb 100755 --- a/advanced/Scripts/updatecheck.sh +++ b/advanced/Scripts/updatecheck.sh @@ -34,7 +34,7 @@ function get_local_branch() { function get_local_version() { # Return active branch cd "${1}" 2> /dev/null || return 1 - git describe --long --dirty --tags || return 1 + git describe --long --dirty --tags 2> /dev/null || return 1 } # Source the setupvars config file diff --git a/advanced/Scripts/webpage.sh b/advanced/Scripts/webpage.sh index abac22d4..ea699efa 100755 --- a/advanced/Scripts/webpage.sh +++ b/advanced/Scripts/webpage.sh @@ -531,7 +531,7 @@ Interfaces: Teleporter() { local datetimestamp=$(date "+%Y-%m-%d_%H-%M-%S") - php /var/www/html/admin/scripts/pi-hole/php/teleporter.php > "pi-hole-teleporter_${datetimestamp}.zip" + php /var/www/html/admin/scripts/pi-hole/php/teleporter.php > "pi-hole-teleporter_${datetimestamp}.tar.gz" } addAudit() diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index bb000808..29e565ed 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -413,9 +413,10 @@ make_repo() { rm -rf "${directory}" fi # Clone the repo and return the return code from this command - git clone -q --depth 1 "${remoteRepo}" "${directory}" &> /dev/null || return $? + git clone -q --depth 20 "${remoteRepo}" "${directory}" &> /dev/null || return $? # Data in the repositories is public anyway so we can make it readable by everyone (+r to keep executable permission if already set by git) chmod -R a+rX "${directory}" + # Show a colored message showing it's status printf "%b %b %s\\n" "${OVER}" "${TICK}" "${str}" # Always return 0? Not sure this is correct @@ -531,7 +532,7 @@ find_IPv4_information() { fi # Append the CIDR notation to the IP address, if valid_ip fails this should return 127.0.0.1/8 - IPV4_ADDRESS=$(ip -oneline -family inet address show | grep "${IPv4bare}" | awk '{print $4}' | awk 'END {print}') + IPV4_ADDRESS=$(ip -oneline -family inet address show | grep "${IPv4bare}/" | awk '{print $4}' | awk 'END {print}') } # Get available interfaces that are UP @@ -1571,7 +1572,7 @@ update_package_cache() { else # show an error and exit printf "%b %b %s\\n" "${OVER}" "${CROSS}" "${str}" - printf " %bError: Unable to update package cache. Please try \"%s\"%b" "${COL_LIGHT_RED}" "${COL_LIGHT_RED}" "${COL_NC}" + printf " %bError: Unable to update package cache. Please try \"%s\"%b" "${COL_LIGHT_RED}" "${UPDATE_PKG_CACHE}" "${COL_NC}" return 1 fi } diff --git a/gravity.sh b/gravity.sh index c01feb9a..b41e8893 100755 --- a/gravity.sh +++ b/gravity.sh @@ -344,7 +344,7 @@ gravity_DownloadBlocklistFromUrl() { port=443; else port=80 fi - bad_list=$(pihole -q -adlist hosts-file.net | head -n1 | awk -F 'Match found in ' '{print $2}') + bad_list=$(pihole -q -adlist "${domain}" | head -n1 | awk -F 'Match found in ' '{print $2}') echo -e "${OVER} ${CROSS} ${str} ${domain} is blocked by ${bad_list%:}. Using DNS on ${PIHOLE_DNS_1} to download ${url}"; echo -ne " ${INFO} ${str} Pending..." cmd_ext="--resolve $domain:$port:$ip $cmd_ext"