From 4cf241b42bd86ce4344076518f99b963506d9cda Mon Sep 17 00:00:00 2001 From: Jeroen Baert <3607063+Forceflow@users.noreply.github.com> Date: Tue, 12 May 2020 19:59:19 +0200 Subject: [PATCH 01/70] Fix for pihole -w --nuke displaying help info even if command is executed correctly Signed-off-by: Jeroen Baert <3607063+Forceflow@users.noreply.github.com> --- advanced/Scripts/list.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/advanced/Scripts/list.sh b/advanced/Scripts/list.sh index 4f2e046f..7efd8758 100755 --- a/advanced/Scripts/list.sh +++ b/advanced/Scripts/list.sh @@ -222,6 +222,7 @@ Displaylist() { NukeList() { sqlite3 "${gravityDBfile}" "DELETE FROM domainlist WHERE type = ${typeId};" + exit 0; } for var in "$@"; do From 6009e869471f7f1da0593d91d82855340c8643b1 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Wed, 1 Jul 2020 18:39:09 +0200 Subject: [PATCH 02/70] Fix pihole status to not rely on a TCP port test. The current test can fail even when there is no error i case the max. number of TCP workers is reached. Signed-off-by: DL6ER --- pihole | 48 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/pihole b/pihole index 065fb385..159922b0 100755 --- a/pihole +++ b/pihole @@ -250,16 +250,52 @@ Options: echo -e "${OVER} ${TICK} ${str}" } +analyze_ports() { + # FTL is listening at least on at least one port when this + # function is getting called + if [[ $(grep -c "IPv4" <<< "${1}") -gt 1 ]] && \ + [[ $(grep -c "IPv6" <<< "${1}") -gt 1 ]]; then + echo -e " ${TICK} DNS service is listening" + else + echo -e " ${CROSS} DNS service is partially listening" + # Check individual address family/protocol combinations + # For a healthy Pi-hole, they should all be up (nothing printed) + if grep -q "IPv4.*UDP" <<< "${1}"; then + echo -e " ${TICK} UDP (IPv4)" + else + echo -e " ${CROSS} UDP (IPv4)" + fi + if grep -q "IPv4.*TCP" <<< "${1}"; then + echo -e " ${TICK} TCP (IPv4)" + else + echo -e " ${CROSS} TCP (IPv4)" + fi + if grep -q "IPv6.*UDP" <<< "${1}"; then + echo -e " ${TICK} UDP (IPv6)" + else + echo -e " ${CROSS} UDP (IPv6)" + fi + if grep -q "IPv6.*TCP" <<< "${1}"; then + echo -e " ${TICK} TCP (IPv6)" + else + echo -e " ${CROSS} TCP (IPv6)" + fi + echo "" + fi +} + statusFunc() { - # Determine if service is running on port 53 (Cr: https://superuser.com/a/806331) - if (echo > /dev/tcp/127.0.0.1/53) >/dev/null 2>&1; then + # Determine if there is a pihole service is listening on port 53 + local listening + listening="$(lsof -Pni:53)" + if grep -q "pihole" <<< "${listening}"; then if [[ "${1}" != "web" ]]; then - echo -e " ${TICK} DNS service is running" + analyze_ports "${listening}" fi else case "${1}" in "web") echo "-1";; - *) echo -e " ${CROSS} DNS service is NOT running";; + *) echo -e " ${CROSS} DNS service is NOT listening";; esac return 0 fi @@ -269,13 +305,13 @@ statusFunc() { # A config is commented out case "${1}" in "web") echo 0;; - *) echo -e " ${CROSS} Pi-hole blocking is Disabled";; + *) echo -e " ${CROSS} Pi-hole blocking is disabled";; esac elif grep -q "BLOCKING_ENABLED=true" /etc/pihole/setupVars.conf; then # Configs are set case "${1}" in "web") echo 1;; - *) echo -e " ${TICK} Pi-hole blocking is Enabled";; + *) echo -e " ${TICK} Pi-hole blocking is enabled";; esac else # No configs were found From 94cd7f59d43e9cdb39312da25cef913699d208e2 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Wed, 1 Jul 2020 18:49:31 +0200 Subject: [PATCH 03/70] Make verbose output the default. Signed-off-by: DL6ER --- pihole | 49 ++++++++++++++++++++++--------------------------- 1 file changed, 22 insertions(+), 27 deletions(-) diff --git a/pihole b/pihole index 159922b0..099eefe5 100755 --- a/pihole +++ b/pihole @@ -253,35 +253,30 @@ Options: analyze_ports() { # FTL is listening at least on at least one port when this # function is getting called - if [[ $(grep -c "IPv4" <<< "${1}") -gt 1 ]] && \ - [[ $(grep -c "IPv6" <<< "${1}") -gt 1 ]]; then - echo -e " ${TICK} DNS service is listening" + echo -e " ${TICK} DNS service is listening" + # Check individual address family/protocol combinations + # For a healthy Pi-hole, they should all be up (nothing printed) + if grep -q "IPv4.*UDP" <<< "${1}"; then + echo -e " ${TICK} UDP (IPv4)" else - echo -e " ${CROSS} DNS service is partially listening" - # Check individual address family/protocol combinations - # For a healthy Pi-hole, they should all be up (nothing printed) - if grep -q "IPv4.*UDP" <<< "${1}"; then - echo -e " ${TICK} UDP (IPv4)" - else - echo -e " ${CROSS} UDP (IPv4)" - fi - if grep -q "IPv4.*TCP" <<< "${1}"; then - echo -e " ${TICK} TCP (IPv4)" - else - echo -e " ${CROSS} TCP (IPv4)" - fi - if grep -q "IPv6.*UDP" <<< "${1}"; then - echo -e " ${TICK} UDP (IPv6)" - else - echo -e " ${CROSS} UDP (IPv6)" - fi - if grep -q "IPv6.*TCP" <<< "${1}"; then - echo -e " ${TICK} TCP (IPv6)" - else - echo -e " ${CROSS} TCP (IPv6)" - fi - echo "" + echo -e " ${CROSS} UDP (IPv4)" fi + if grep -q "IPv4.*TCP" <<< "${1}"; then + echo -e " ${TICK} TCP (IPv4)" + else + echo -e " ${CROSS} TCP (IPv4)" + fi + if grep -q "IPv6.*UDP" <<< "${1}"; then + echo -e " ${TICK} UDP (IPv6)" + else + echo -e " ${CROSS} UDP (IPv6)" + fi + if grep -q "IPv6.*TCP" <<< "${1}"; then + echo -e " ${TICK} TCP (IPv6)" + else + echo -e " ${CROSS} TCP (IPv6)" + fi + echo "" } statusFunc() { From 73963fecda6dc65b10d1dd3e43a5931dc531304a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Sun, 5 Jul 2020 14:32:33 +0200 Subject: [PATCH 04/70] Use gravity's adlist_id in filename when saving downloaded adlist locally MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- gravity.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gravity.sh b/gravity.sh index 9d4c7bee..5095c2b7 100755 --- a/gravity.sh +++ b/gravity.sh @@ -359,9 +359,10 @@ gravity_DownloadBlocklists() { for ((i = 0; i < "${#sources[@]}"; i++)); do url="${sources[$i]}" domain="${sourceDomains[$i]}" + id="${sourceIDs[$i]}" # Save the file as list.#.domain - saveLocation="${piholeDir}/list.${i}.${domain}.${domainsExtension}" + saveLocation="${piholeDir}/list.${id}.${domain}.${domainsExtension}" activeDomains[$i]="${saveLocation}" # Default user-agent (for Cloudflare's Browser Integrity Check: https://support.cloudflare.com/hc/en-us/articles/200170086-What-does-the-Browser-Integrity-Check-do-) From 25b873cf7b6062e3b4175703a2f1ae202d596ab5 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 2 Jul 2020 23:19:30 +0200 Subject: [PATCH 05/70] Add default locations to PATH to assure that all basic commands are available Signed-off-by: MichaIng --- automated install/basic-install.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 28001831..36237c9c 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -21,6 +21,10 @@ # instead of continuing the installation with something broken set -e +# Set PATH to a usual default to assure that all basic commands are available. +# When using "su" an uncomplete PATH could be passed: https://github.com/pi-hole/pi-hole/issues/3209 +export PATH+=':/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' + ######## VARIABLES ######### # For better maintainability, we store as much information that can change in variables # This allows us to make a change in one place that can propagate to all instances of the variable From 27366fe9f0f399316960d08752d4fff2539a3095 Mon Sep 17 00:00:00 2001 From: Josh Date: Sun, 19 Jul 2020 07:35:44 -0400 Subject: [PATCH 06/70] chore(README.md): Grammar fix Fix small grammar issue in README.md Signed-off-by: Jokajak --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 68d7c09f..c91c84bf 100644 --- a/README.md +++ b/README.md @@ -162,4 +162,4 @@ Some of the statistics you can integrate include: - Queries cached - Unique clients -The API can be accessed via [`telnet`](https://github.com/pi-hole/FTL), the Web (`admin/api.php`) and Command Line (`pihole -c -j`). You can out find [more details over here](https://discourse.pi-hole.net/t/pi-hole-api/1863). +The API can be accessed via [`telnet`](https://github.com/pi-hole/FTL), the Web (`admin/api.php`) and Command Line (`pihole -c -j`). You can find out [more details over here](https://discourse.pi-hole.net/t/pi-hole-api/1863). From 93c1a629986874bd92bb9b23fdb7a2693948ba98 Mon Sep 17 00:00:00 2001 From: James Lagermann Date: Tue, 21 Jul 2020 14:32:29 -0500 Subject: [PATCH 07/70] Update CONTRIBUTING.md Co-authored-by: jrschat <54955683+jrschat@users.noreply.github.com> signed-off-by: James Lagermann --- CONTRIBUTING.md | 57 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e32b500e..2d9b0808 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -36,3 +36,60 @@ When requesting or submitting new features, first consider whether it might be u - Commit Unix line endings. - Please use the Pi-hole brand: **Pi-hole** (Take a special look at the capitalized 'P' and a low 'h' with a hyphen) - (Optional fun) keep to the theme of Star Trek/black holes/gravity. + +## Forking and Cloning from GitHub to GitHub + +1. Fork to a repo under a namespace you control, or have permission to use, example: `https://github.com///`. You can do this from the github.com website. +2. Clone `https://github.com///` with the tool of you choice. +3. To keep your fork in sync with our repo, add an upstream remote for pi-hole/pi-hole to your repo. + ```console + git remote add upstream https://github.com/pi-hole/pi-hole.git + ``` +4. Checkout the `development` branch from your clone `https://github.com///`. +5. Create a topic/branch, based on the `development` branch code. *Bonus fun to keep to the theme of Star Trek/black holes/gravity.* +6. Make your changes and commit to your topic branch in your repo. +7. Rebase your commits and squash any insignificant commits. See notes below for an example. +8. Merge `development` your branch and fix any conflicts. +9. Open a Pull Request to merge your topic branch into our repo's `development` branch. +- Keep in mind the technical requirements from above. + +## Forking and Cloning from GitHub to other code hosting sites + +- Forking is a GitHub concept and cannot be done from GitHub to other git based code hosting sites. However, from those sites may be able to mirror a GitHub repo. +1. To contribute from another code hosting site, you must first complete the steps above to fork our repo to a GitHub namespace you have permission to use, example: `https://github.com///`. +2. Create a repo in your code hosting site, for example: `https://gitlab.com///` +3. Follow the instructions from your code hosting site to create a mirror between `https://github.com///` and `https://gitlab.com///`. +4. When you are ready to create a Pull Request (PR), follow the steps `(starting at step #6)` from [Forking and Cloning from GitHub to GitHub](#forking-and-cloning-from-github-to-github) and create the PR from `https://github.com///`. + +## Notes for squashing commits with rebase + +- To rebase your commits and squash previous commits, you can use: + ```bash + git rebase -i your_topic_branch~(# of commits to combine) + ``` +- For more details visit [gitready.com](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html) +1. The following would combine the last four commits in the branch `mytopic`. + ```bash + git rebase -i mytopic~4 + ``` +2. An editor window opens with the most recent commits indicated: (edit the commands to the left of the commit ID) + ```gitattributes + pick 9dff55b2 existing commit comments + squash ebb1a730 existing commit comments + squash 07cc5b50 existing commit comments + reword 9dff55b2 existing commit comments + ``` +3. Save and close the editor. The next editor window opens: (edit the new commit message). *If you select reword for a commit, an additional editor window will open for you to edit the comment.* + ```console + new commit comments + Signed-off-by: yourname + ``` +4. Save and close the editor for the rebase process to execute. The terminal output should say something like the following: + ```console + Successfully rebased and updated refs/heads/mytopic. + ``` +5. Once you have a successful rebase, and before you sync your local clone, you have to force push origin to update your repo: + ```console + git push -f origin + ``` +6. Continue on from step #7 from [Forking and Cloning from GitHub to GitHub](#forking-and-cloning-from-github-to-github) From be140007789a92a83c9c542e23182825c64b644a Mon Sep 17 00:00:00 2001 From: James Lagermann Date: Tue, 21 Jul 2020 15:02:23 -0500 Subject: [PATCH 08/70] added blanks-around-fences to correct lint errors Signed-off-by: James Lagermann --- CONTRIBUTING.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2d9b0808..bba6b3fc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -42,20 +42,24 @@ When requesting or submitting new features, first consider whether it might be u 1. Fork to a repo under a namespace you control, or have permission to use, example: `https://github.com///`. You can do this from the github.com website. 2. Clone `https://github.com///` with the tool of you choice. 3. To keep your fork in sync with our repo, add an upstream remote for pi-hole/pi-hole to your repo. + ```console git remote add upstream https://github.com/pi-hole/pi-hole.git ``` + 4. Checkout the `development` branch from your clone `https://github.com///`. 5. Create a topic/branch, based on the `development` branch code. *Bonus fun to keep to the theme of Star Trek/black holes/gravity.* 6. Make your changes and commit to your topic branch in your repo. 7. Rebase your commits and squash any insignificant commits. See notes below for an example. 8. Merge `development` your branch and fix any conflicts. 9. Open a Pull Request to merge your topic branch into our repo's `development` branch. + - Keep in mind the technical requirements from above. ## Forking and Cloning from GitHub to other code hosting sites - Forking is a GitHub concept and cannot be done from GitHub to other git based code hosting sites. However, from those sites may be able to mirror a GitHub repo. + 1. To contribute from another code hosting site, you must first complete the steps above to fork our repo to a GitHub namespace you have permission to use, example: `https://github.com///`. 2. Create a repo in your code hosting site, for example: `https://gitlab.com///` 3. Follow the instructions from your code hosting site to create a mirror between `https://github.com///` and `https://gitlab.com///`. @@ -64,32 +68,45 @@ When requesting or submitting new features, first consider whether it might be u ## Notes for squashing commits with rebase - To rebase your commits and squash previous commits, you can use: + ```bash git rebase -i your_topic_branch~(# of commits to combine) ``` + - For more details visit [gitready.com](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html) + 1. The following would combine the last four commits in the branch `mytopic`. + ```bash git rebase -i mytopic~4 ``` + 2. An editor window opens with the most recent commits indicated: (edit the commands to the left of the commit ID) + ```gitattributes pick 9dff55b2 existing commit comments squash ebb1a730 existing commit comments squash 07cc5b50 existing commit comments reword 9dff55b2 existing commit comments ``` + 3. Save and close the editor. The next editor window opens: (edit the new commit message). *If you select reword for a commit, an additional editor window will open for you to edit the comment.* + ```console new commit comments Signed-off-by: yourname ``` + 4. Save and close the editor for the rebase process to execute. The terminal output should say something like the following: + ```console Successfully rebased and updated refs/heads/mytopic. ``` + 5. Once you have a successful rebase, and before you sync your local clone, you have to force push origin to update your repo: + ```console git push -f origin ``` + 6. Continue on from step #7 from [Forking and Cloning from GitHub to GitHub](#forking-and-cloning-from-github-to-github) From 18c24d985f6cf1e7acf7b4b935556a704d6357be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Thu, 23 Jul 2020 20:43:12 +0200 Subject: [PATCH 09/70] Create custom.list during install/update if it doesn't exist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- automated install/basic-install.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 5aa20187..2887fe56 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -70,6 +70,7 @@ PI_HOLE_BLOCKPAGE_DIR="${webroot}/pihole" useUpdateVars=false adlistFile="/etc/pihole/adlists.list" +="${PI_HOLE_CONFIG_DIR}/custom.list" # Pi-hole needs an IP address; to begin, these variables are empty since we don't know what the IP is until # this script can run IPV4_ADDRESS=${IPV4_ADDRESS} @@ -1810,6 +1811,16 @@ installPiholeWeb() { printf "%b %b %s\\n" "${OVER}" "${TICK}" "${str}" } +# Creates custom DNS file if it does not exist +installCustomDNSfile() { + + if [[ ! -e "${customDNSfile}" ]]; then + touch "${customDNSfile}" + chmod 644 "${customDNSfile}" + fi + +} + # Installs a cron file installCron() { # Install the cron job @@ -2037,6 +2048,9 @@ installPihole() { # install a man page entry for pihole install_manpage + # install custom DNS file if it does not exist + installCustomDNSfile + # Update setupvars.conf with any variables that may or may not have been changed during the install finalExports } From 331502e14cc31972f4653b9741b931be7569031a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Thu, 23 Jul 2020 20:52:21 +0200 Subject: [PATCH 10/70] Add variable that got lost MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- automated install/basic-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 2887fe56..b682fa33 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -70,7 +70,7 @@ PI_HOLE_BLOCKPAGE_DIR="${webroot}/pihole" useUpdateVars=false adlistFile="/etc/pihole/adlists.list" -="${PI_HOLE_CONFIG_DIR}/custom.list" +customDNSfile="${PI_HOLE_CONFIG_DIR}/custom.list" # Pi-hole needs an IP address; to begin, these variables are empty since we don't know what the IP is until # this script can run IPV4_ADDRESS=${IPV4_ADDRESS} From ec9f490fcc0c31a559d3d523dd22796cb31a94e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Fri, 24 Jul 2020 20:32:32 +0200 Subject: [PATCH 11/70] Remove separate install function, move to installConfigs(), use pihole syntax MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- automated install/basic-install.sh | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index b682fa33..fc90154a 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -70,7 +70,6 @@ PI_HOLE_BLOCKPAGE_DIR="${webroot}/pihole" useUpdateVars=false adlistFile="/etc/pihole/adlists.list" -customDNSfile="${PI_HOLE_CONFIG_DIR}/custom.list" # Pi-hole needs an IP address; to begin, these variables are empty since we don't know what the IP is until # this script can run IPV4_ADDRESS=${IPV4_ADDRESS} @@ -1477,6 +1476,15 @@ installConfigs() { return 1 fi fi + + # Install empty custom.list file if it does not exist + if [[ ! -r "${PI_HOLE_CONFIG_DIR}/custom.list" ]]; then + if ! install -o root -m 664 /dev/null "${PI_HOLE_CONFIG_DIR}/custom.list" &>/dev/null; then + printf " %bError: Unable to initialize configuration file %s/custom.list\\n" "${COL_LIGHT_RED}" "${PI_HOLE_CONFIG_DIR}" + return 1 + fi + fi + # If the user chose to install the dashboard, if [[ "${INSTALL_WEB_SERVER}" == true ]]; then # and if the Web server conf directory does not exist, @@ -1811,15 +1819,6 @@ installPiholeWeb() { printf "%b %b %s\\n" "${OVER}" "${TICK}" "${str}" } -# Creates custom DNS file if it does not exist -installCustomDNSfile() { - - if [[ ! -e "${customDNSfile}" ]]; then - touch "${customDNSfile}" - chmod 644 "${customDNSfile}" - fi - -} # Installs a cron file installCron() { @@ -2048,9 +2047,6 @@ installPihole() { # install a man page entry for pihole install_manpage - # install custom DNS file if it does not exist - installCustomDNSfile - # Update setupvars.conf with any variables that may or may not have been changed during the install finalExports } From dfcdfd4b0a9244db5b2e923fdf0f47fef79e3fcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Sun, 26 Jul 2020 12:27:55 +0200 Subject: [PATCH 12/70] Remove empty line MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- automated install/basic-install.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index fc90154a..8f98e16f 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -1484,7 +1484,7 @@ installConfigs() { return 1 fi fi - + # If the user chose to install the dashboard, if [[ "${INSTALL_WEB_SERVER}" == true ]]; then # and if the Web server conf directory does not exist, @@ -1819,7 +1819,6 @@ installPiholeWeb() { printf "%b %b %s\\n" "${OVER}" "${TICK}" "${str}" } - # Installs a cron file installCron() { # Install the cron job From 0a81d687e83de65e337f533c71dcdac0d2810a6c Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Sun, 26 Jul 2020 12:31:11 -0700 Subject: [PATCH 13/70] Update automated install/basic-install.sh --- automated install/basic-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 8f98e16f..4bc932e6 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -1479,7 +1479,7 @@ installConfigs() { # Install empty custom.list file if it does not exist if [[ ! -r "${PI_HOLE_CONFIG_DIR}/custom.list" ]]; then - if ! install -o root -m 664 /dev/null "${PI_HOLE_CONFIG_DIR}/custom.list" &>/dev/null; then + if ! install -o root -m 644 /dev/null "${PI_HOLE_CONFIG_DIR}/custom.list" &>/dev/null; then printf " %bError: Unable to initialize configuration file %s/custom.list\\n" "${COL_LIGHT_RED}" "${PI_HOLE_CONFIG_DIR}" return 1 fi From 51daeaa6ab40bea02d99ebde65e6cbf405ecd1f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Thu, 23 Jul 2020 16:19:56 +0200 Subject: [PATCH 14/70] basic-install: document how to continue after SELinux check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian Göttsche --- automated install/basic-install.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 4bc932e6..aed3acd2 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -2086,8 +2086,13 @@ checkSelinux() { if [[ "${SELINUX_ENFORCING}" -eq 1 ]] && [[ -z "${PIHOLE_SELINUX}" ]]; then printf " Pi-hole does not provide an SELinux policy as the required changes modify the security of your system.\\n" printf " Please refer to https://wiki.centos.org/HowTos/SELinux if SELinux is required for your deployment.\\n" + printf " This check can be skipped by setting the environment variable %bPIHOLE_SELINUX%b to %btrue%b\\n" "${COL_LIGHT_RED}" "${COL_NC}" "${COL_LIGHT_RED}" "${COL_NC}" + printf " e.g: export PIHOLE_SELINUX=true\\n" + printf " By setting this variable to true you acknowledge there may be issues with Pi-hole during or after the install\\n" printf "\\n %bSELinux Enforcing detected, exiting installer%b\\n" "${COL_LIGHT_RED}" "${COL_NC}"; exit 1; + elif [[ "${SELINUX_ENFORCING}" -eq 1 ]] && [[ -n "${PIHOLE_SELINUX}" ]]; then + printf " %b %bSELinux Enforcing detected%b. PIHOLE_SELINUX env variable set - installer will continue\\n" "${INFO}" "${COL_LIGHT_RED}" "${COL_NC}" fi } From 5a484781966d15e6256d4ecc1e8c0ee99b6eaea4 Mon Sep 17 00:00:00 2001 From: Nathan Friend Date: Sat, 1 Aug 2020 20:00:49 -0500 Subject: [PATCH 15/70] Update "About Pi-hole" link Signed-off-by: Nathan Friend --- advanced/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advanced/index.php b/advanced/index.php index 4356f0b0..b6597c51 100644 --- a/advanced/index.php +++ b/advanced/index.php @@ -305,7 +305,7 @@ setHeader();

From 87da9084e60499b0b62e19c4b2a9275f5cd4f99d Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sat, 10 Aug 2019 13:33:30 +0200 Subject: [PATCH 16/70] Use compression (if available) when downloading the ad lists. Signed-off-by: DL6ER --- gravity.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/gravity.sh b/gravity.sh index 5095c2b7..1153466d 100755 --- a/gravity.sh +++ b/gravity.sh @@ -457,7 +457,7 @@ parseList() { # Download specified URL and perform checks on HTTP status and file content gravity_DownloadBlocklistFromUrl() { local url="${1}" cmd_ext="${2}" agent="${3}" adlistID="${4}" saveLocation="${5}" target="${6}" - local heisenbergCompensator="" patternBuffer str httpCode success="" + local heisenbergCompensator="" patternBuffer str httpCode success="" compression # Create temp file to store content on disk instead of RAM patternBuffer=$(mktemp -p "/tmp" --suffix=".phgpb") @@ -505,8 +505,18 @@ gravity_DownloadBlocklistFromUrl() { echo -ne " ${INFO} ${str} Pending..." cmd_ext="--resolve $domain:$port:$ip $cmd_ext" fi + + # Use compression to reduce the amount of data that is transfered + # between the Pi-hole and the ad list provider. Use this feature + # only if it is supported by the locally available version of curl + if curl -V | grep -q "Features:.* libz"; then + compression="--compressed" + else + compression="" + fi + # shellcheck disable=SC2086 - httpCode=$(curl -s -L ${cmd_ext} ${heisenbergCompensator} -w "%{http_code}" -A "${agent}" "${url}" -o "${patternBuffer}" 2> /dev/null) + httpCode=$(curl -s -L ${compression} ${cmd_ext} ${heisenbergCompensator} -w "%{http_code}" -A "${agent}" "${url}" -o "${patternBuffer}" 2> /dev/null) case $url in # Did we "download" a local file? From 27399a762a54878fa32171deb6cb15559930a444 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Mon, 3 Aug 2020 22:46:14 +0200 Subject: [PATCH 17/70] Check for compression onyl once and print result MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- gravity.sh | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/gravity.sh b/gravity.sh index 1153466d..001004fe 100755 --- a/gravity.sh +++ b/gravity.sh @@ -336,7 +336,7 @@ gravity_DownloadBlocklists() { return 1 fi - local url domain agent cmd_ext str target + local url domain agent cmd_ext str target compression echo "" # Prepare new gravity database @@ -355,6 +355,16 @@ gravity_DownloadBlocklists() { target="$(mktemp -p "/tmp" --suffix=".gravity")" + # Use compression to reduce the amount of data that is transfered + # between the Pi-hole and the ad list provider. Use this feature + # only if it is supported by the locally available version of curl + if curl -V | grep -q "Features:.* libz"; then + compression="--compressed" + echo -e " ${INFO} Using libz compression\n" + else + compression="" + echo -e " ${INFO} Libz compression not available\n" + fi # Loop through $sources and download each one for ((i = 0; i < "${#sources[@]}"; i++)); do url="${sources[$i]}" @@ -381,7 +391,7 @@ gravity_DownloadBlocklists() { if [[ "${url}" =~ ${regex} ]]; then echo -e " ${CROSS} Invalid Target" else - gravity_DownloadBlocklistFromUrl "${url}" "${cmd_ext}" "${agent}" "${sourceIDs[$i]}" "${saveLocation}" "${target}" + gravity_DownloadBlocklistFromUrl "${url}" "${cmd_ext}" "${agent}" "${sourceIDs[$i]}" "${saveLocation}" "${target}" "${compression}" fi echo "" done @@ -456,8 +466,8 @@ parseList() { # Download specified URL and perform checks on HTTP status and file content gravity_DownloadBlocklistFromUrl() { - local url="${1}" cmd_ext="${2}" agent="${3}" adlistID="${4}" saveLocation="${5}" target="${6}" - local heisenbergCompensator="" patternBuffer str httpCode success="" compression + local url="${1}" cmd_ext="${2}" agent="${3}" adlistID="${4}" saveLocation="${5}" target="${6}" compression="${7}" + local heisenbergCompensator="" patternBuffer str httpCode success="" # Create temp file to store content on disk instead of RAM patternBuffer=$(mktemp -p "/tmp" --suffix=".phgpb") @@ -506,15 +516,6 @@ gravity_DownloadBlocklistFromUrl() { cmd_ext="--resolve $domain:$port:$ip $cmd_ext" fi - # Use compression to reduce the amount of data that is transfered - # between the Pi-hole and the ad list provider. Use this feature - # only if it is supported by the locally available version of curl - if curl -V | grep -q "Features:.* libz"; then - compression="--compressed" - else - compression="" - fi - # shellcheck disable=SC2086 httpCode=$(curl -s -L ${compression} ${cmd_ext} ${heisenbergCompensator} -w "%{http_code}" -A "${agent}" "${url}" -o "${patternBuffer}" 2> /dev/null) From 8b4921405aee3b48156c5c408c0e420b6601d132 Mon Sep 17 00:00:00 2001 From: Samuel Boucher Date: Sun, 9 Aug 2020 13:21:58 -0400 Subject: [PATCH 18/70] Upercase the temp_unit Signed-off-by: Samuel Boucher --- advanced/Scripts/chronometer.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/advanced/Scripts/chronometer.sh b/advanced/Scripts/chronometer.sh index 98f43c3f..77fc3bb4 100755 --- a/advanced/Scripts/chronometer.sh +++ b/advanced/Scripts/chronometer.sh @@ -237,6 +237,7 @@ get_sys_stats() { sys_name=$(hostname) [[ -n "$TEMPERATUREUNIT" ]] && temp_unit="$TEMPERATUREUNIT" || temp_unit="c" + temp_unit="${temp_unit^^}" # Get storage stats for partition mounted on / read -r -a disk_raw <<< "$(df -B1 / 2> /dev/null | awk 'END{ print $3,$2,$5 }')" From d4dd446ba306db15089d04b25437b4bbef7bf081 Mon Sep 17 00:00:00 2001 From: Samuel Boucher Date: Sun, 9 Aug 2020 17:08:44 -0400 Subject: [PATCH 19/70] Update advanced/Scripts/chronometer.sh Co-authored-by: Dan Schaper Signed-off-by: Samuel Boucher --- advanced/Scripts/chronometer.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/advanced/Scripts/chronometer.sh b/advanced/Scripts/chronometer.sh index 77fc3bb4..37fd5177 100755 --- a/advanced/Scripts/chronometer.sh +++ b/advanced/Scripts/chronometer.sh @@ -236,8 +236,7 @@ get_sys_stats() { sys_name=$(hostname) - [[ -n "$TEMPERATUREUNIT" ]] && temp_unit="$TEMPERATUREUNIT" || temp_unit="c" - temp_unit="${temp_unit^^}" + [[ -n "$TEMPERATUREUNIT" ]] && temp_unit="${TEMPERATUREUNIT^^}" || temp_unit="C" # Get storage stats for partition mounted on / read -r -a disk_raw <<< "$(df -B1 / 2> /dev/null | awk 'END{ print $3,$2,$5 }')" From 5c72ff75d9dcc1347b0804baf6173dd4d5a1cb48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Mon, 10 Aug 2020 23:52:53 +0200 Subject: [PATCH 20/70] Revert "fix #3336 by creating adlist file even if no list was selected by user" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3c6ea2612dabc04ac94da90fe270092671a1a647. Signed-off-by: Christian König --- automated install/basic-install.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index b2bdfa04..02179ed5 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -1292,9 +1292,7 @@ chooseBlocklists() { # In a variable, show the choices available; exit if Cancel is selected choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty) || { printf " %bCancel was selected, exiting installer%b\\n" "${COL_LIGHT_RED}" "${COL_NC}"; rm "${adlistFile}" ;exit 1; } - # create empty adlist file if no list was selected - : > "${adlistFile}" - # For each choice available + # For each choice available, for choice in ${choices} do appendToListsFile "${choice}" From 5b1eaa7e380c71758e085ea936ce7a7488046c61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Tue, 11 Aug 2020 22:35:33 +0200 Subject: [PATCH 21/70] Removes broken youtube link MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c91c84bf..6d7e5b5e 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ The Pi-hole® is a [DNS sinkhole](https://en.wikipedia.org/wiki/DNS_Sinkhole) that protects your devices from unwanted content, without installing any client-side software. -- **Easy-to-install**: our versatile installer walks you through the process, and [takes less than ten minutes](https://www.youtube.com/watch?v=vKWjx1AQYgs) +- **Easy-to-install**: our versatile installer walks you through the process, and takes less than ten minutes - **Resolute**: content is blocked in _non-browser locations_, such as ad-laden mobile apps and smart TVs - **Responsive**: seamlessly speeds up the feel of everyday browsing by caching DNS queries - **Lightweight**: runs smoothly with [minimal hardware and software requirements](https://docs.pi-hole.net/main/prerequisites/) From 57e65dd5c07a83b05d469250de2432d80d7144b5 Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Fri, 14 Aug 2020 11:42:54 -0700 Subject: [PATCH 22/70] Use fewer subshells and descriptive variables. Signed-off-by: Dan Schaper --- automated install/basic-install.sh | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 65212c57..2f7fc809 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -182,15 +182,11 @@ os_check() { if [ "$PIHOLE_SKIP_OS_CHECK" != true ]; then # This function gets a list of supported OS versions from a TXT record at versions.pi-hole.net # and determines whether or not the script is running on one of those systems - local remote_os_domain valid_os valid_version detected_os_pretty detected_os detected_version display_warning + local remote_os_domain valid_os valid_version detected_os detected_version display_warning remote_os_domain="versions.pi-hole.net" - valid_os=false - valid_version=false - display_warning=true - detected_os_pretty=$(cat /etc/*release | grep PRETTY_NAME | cut -d '=' -f2- | tr -d '"') - detected_os="${detected_os_pretty%% *}" - detected_version=$(cat /etc/*release | grep VERSION_ID | 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 '"') IFS=" " read -r -a supportedOS < <(dig +short -t txt ${remote_os_domain} @ns1.pi-hole.net | tr -d '"') @@ -198,17 +194,17 @@ os_check() { printf " %b %bRetrieval of supported OS failed. Please contact support. %b\\n" "${CROSS}" "${COL_LIGHT_RED}" "${COL_NC}" exit 1 else - for i in "${supportedOS[@]}" + for distro_and_versions in "${supportedOS[@]}" do - os_part=$(echo "$i" | cut -d '=' -f1) - versions_part=$(echo "$i" | cut -d '=' -f2-) + distro_part="${distro_and_versions%%=*}" + versions_part="${distro_and_versions##*=}" - if [[ "${detected_os}" =~ ${os_part} ]]; then + if [[ "${detected_os^^}" =~ ${distro_part^^} ]]; then valid_os=true IFS="," read -r -a supportedVer <<<"${versions_part}" - for x in "${supportedVer[@]}" + for version in "${supportedVer[@]}" do - if [[ "${detected_version}" =~ $x ]];then + if [[ "${detected_version}" =~ $version ]]; then valid_version=true break fi @@ -222,7 +218,7 @@ os_check() { display_warning=false fi - if [ "$display_warning" = true ]; then + if [ "$display_warning" != false ]; then printf " %b %bUnsupported OS detected: %s%b\\n" "${CROSS}" "${COL_LIGHT_RED}" "${detected_os_pretty}" "${COL_NC}" printf " https://docs.pi-hole.net/main/prerequesites/#supported-operating-systems\\n" printf "\\n" From 623ce1fe181ca3526fad485b92dc96e8b6ac8a65 Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Fri, 14 Aug 2020 14:37:58 -0700 Subject: [PATCH 23/70] Tabs and debug.sh Signed-off-by: Dan Schaper --- advanced/Scripts/piholeDebug.sh | 39 ++++++++++++++---------------- automated install/basic-install.sh | 32 ++++++++++++------------ 2 files changed, 34 insertions(+), 37 deletions(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index 92d6dad7..1fed32cf 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -396,33 +396,30 @@ check_critical_program_versions() { os_check() { # This function gets a list of supported OS versions from a TXT record at versions.pi-hole.net # and determines whether or not the script is running on one of those systems - local remote_os_domain valid_os valid_version detected_os_pretty detected_os detected_version + local remote_os_domain valid_os valid_version detected_os detected_version remote_os_domain="versions.pi-hole.net" - valid_os=false - valid_version=false - detected_os_pretty=$(cat /etc/*release | grep PRETTY_NAME | cut -d '=' -f2- | tr -d '"') - detected_os="${detected_os_pretty%% *}" - detected_version=$(cat /etc/*release | grep VERSION_ID | 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 '"') - IFS=" " read -r -a supportedOS < <(dig +short -t txt ${remote_os_domain} | tr -d '"') + IFS=" " read -r -a supportedOS < <(dig +short -t txt ${remote_os_domain} @ns1.pi-hole.net | tr -d '"') - for i in "${supportedOS[@]}" + for distro_and_versions in "${supportedOS[@]}" do - os_part=$(echo "$i" | cut -d '=' -f1) - versions_part=$(echo "$i" | cut -d '=' -f2-) + distro_part="${distro_and_versions%%=*}" + versions_part="${distro_and_versions##*=}" - if [[ "${detected_os}" =~ ${os_part} ]]; then - valid_os=true - IFS="," read -r -a supportedVer <<<"${versions_part}" - for x in "${supportedVer[@]}" - do - if [[ "${detected_version}" =~ $x ]];then - valid_version=true - break - fi - done - break + if [[ "${detected_os^^}" =~ ${distro_part^^} ]]; then + valid_os=true + IFS="," read -r -a supportedVer <<<"${versions_part}" + for version in "${supportedVer[@]}" + do + if [[ "${detected_version}" =~ $version ]]; then + valid_version=true + break + fi + done + break fi done diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 2f7fc809..dc3d6b08 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -194,25 +194,25 @@ os_check() { printf " %b %bRetrieval of supported OS failed. Please contact support. %b\\n" "${CROSS}" "${COL_LIGHT_RED}" "${COL_NC}" exit 1 else - for distro_and_versions in "${supportedOS[@]}" - do - distro_part="${distro_and_versions%%=*}" - versions_part="${distro_and_versions##*=}" + for distro_and_versions in "${supportedOS[@]}" + do + distro_part="${distro_and_versions%%=*}" + versions_part="${distro_and_versions##*=}" - if [[ "${detected_os^^}" =~ ${distro_part^^} ]]; then - valid_os=true - IFS="," read -r -a supportedVer <<<"${versions_part}" - for version in "${supportedVer[@]}" - do - if [[ "${detected_version}" =~ $version ]]; then - valid_version=true + if [[ "${detected_os^^}" =~ ${distro_part^^} ]]; then + valid_os=true + IFS="," read -r -a supportedVer <<<"${versions_part}" + for version in "${supportedVer[@]}" + do + if [[ "${detected_version}" =~ $version ]]; then + valid_version=true + break + fi + done break - fi - done - break - fi + fi done - fi + fi if [ "$valid_os" = true ] && [ "$valid_version" = true ]; then display_warning=false From ebdb68a47a13acaaeca79d2e152a84d8d5fb90c4 Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Sat, 15 Aug 2020 10:54:31 -0700 Subject: [PATCH 24/70] display_warning fixes Signed-off-by: Dan Schaper --- advanced/Scripts/piholeDebug.sh | 8 ++++---- automated install/basic-install.sh | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index 1fed32cf..7f66d7ca 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -425,17 +425,17 @@ os_check() { # Display findings back to the user if [ "$valid_os" = true ]; then - log_write "${TICK} Distro: ${COL_GREEN}${detected_os}${COL_NC}" + log_write "${TICK} Distro: ${COL_GREEN}${detected_os^}${COL_NC}" if [ "$valid_version" = true ]; then log_write "${TICK} Version: ${COL_GREEN}${detected_version}${COL_NC}" else log_write "${CROSS} Version: ${COL_RED}${detected_version}${COL_NC}" - log_write "${CROSS} Error: ${COL_RED}${detected_os} is supported but version ${detected_version} is currently unsupported (${FAQ_HARDWARE_REQUIREMENTS})${COL_NC}" + log_write "${CROSS} Error: ${COL_RED}${detected_os^} is supported but version ${detected_version} is currently unsupported (${FAQ_HARDWARE_REQUIREMENTS})${COL_NC}" fi else - log_write "${CROSS} Distro: ${COL_RED}${detected_os}${COL_NC}" - log_write "${CROSS} Error: ${COL_RED}${detected_os} is not a supported distro (${FAQ_HARDWARE_REQUIREMENTS})${COL_NC}" + log_write "${CROSS} Distro: ${COL_RED}${detected_os^}${COL_NC}" + log_write "${CROSS} Error: ${COL_RED}${detected_os^} is not a supported distro (${FAQ_HARDWARE_REQUIREMENTS})${COL_NC}" fi } diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index dc3d6b08..d8a408a9 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -219,7 +219,7 @@ os_check() { fi if [ "$display_warning" != false ]; then - printf " %b %bUnsupported OS detected: %s%b\\n" "${CROSS}" "${COL_LIGHT_RED}" "${detected_os_pretty}" "${COL_NC}" + printf " %b %bUnsupported OS detected: %s %s%b\\n" "${CROSS}" "${COL_LIGHT_RED}" "${detected_os^}" "${detected_version}" "${COL_NC}" printf " https://docs.pi-hole.net/main/prerequesites/#supported-operating-systems\\n" printf "\\n" printf " e.g: If you are seeing this message on a fresh install, you can run:\\n" From 65786ba5d6b2060f995c71276a9d3b9503594e2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Tue, 18 Aug 2020 20:16:35 +0200 Subject: [PATCH 25/70] Remove check for free disk space and associated variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- automated install/basic-install.sh | 56 ------------------------------ 1 file changed, 56 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 67d21ac5..a0863714 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -110,7 +110,6 @@ c=$(( c < 70 ? 70 : c )) ######## Undocumented Flags. Shhh ######## # These are undocumented flags; some of which we can use when repairing an installation # The runUnattended flag is one example of this -skipSpaceCheck=false reconfigure=false runUnattended=false INSTALL_WEB_SERVER=true @@ -118,7 +117,6 @@ INSTALL_WEB_SERVER=true for var in "$@"; do case "$var" in "--reconfigure" ) reconfigure=true;; - "--i_do_not_follow_recommendations" ) skipSpaceCheck=true;; "--unattended" ) runUnattended=true;; "--disable-install-webserver" ) INSTALL_WEB_SERVER=false;; esac @@ -656,53 +654,6 @@ welcomeDialogs() { In the next section, you can choose to use your current network settings (DHCP) or to manually edit them." "${r}" "${c}" } -# We need to make sure there is enough space before installing, so there is a function to check this -verifyFreeDiskSpace() { - # 50MB is the minimum space needed (45MB install (includes web admin bootstrap/jquery libraries etc) + 5MB one day of logs.) - # - Fourdee: Local ensures the variable is only created, and accessible within this function/void. Generally considered a "good" coding practice for non-global variables. - local str="Disk space check" - # Required space in KB - local required_free_kilobytes=51200 - # Calculate existing free space on this machine - local existing_free_kilobytes - existing_free_kilobytes=$(df -Pk | grep -m1 '\/$' | awk '{print $4}') - - # If the existing space is not an integer, - if ! [[ "${existing_free_kilobytes}" =~ ^([0-9])+$ ]]; then - # show an error that we can't determine the free space - printf " %b %s\\n" "${CROSS}" "${str}" - printf " %b Unknown free disk space! \\n" "${INFO}" - printf " We were unable to determine available free disk space on this system.\\n" - printf " You may override this check, however, it is not recommended.\\n" - printf " The option '%b--i_do_not_follow_recommendations%b' can override this.\\n" "${COL_LIGHT_RED}" "${COL_NC}" - printf " e.g: curl -sSL https://install.pi-hole.net | bash /dev/stdin %b