diff --git a/.github/dco.yml b/.github/dco.yml
new file mode 100644
index 00000000..0c4b142e
--- /dev/null
+++ b/.github/dco.yml
@@ -0,0 +1,2 @@
+require:
+ members: false
diff --git a/.pullapprove.yml b/.pullapprove.yml
deleted file mode 100644
index 30888234..00000000
--- a/.pullapprove.yml
+++ /dev/null
@@ -1,38 +0,0 @@
-version: 2
-
-always_pending:
- title_regex: '(WIP|wip)'
- labels:
- - wip
- explanation: 'This PR is a work in progress...'
-
-group_defaults:
- reset_on_push:
- enabled: true
- reject_value: -2
- approve_regex: '^(Approved|:shipit:|:\+1:|Engage|:taco:)'
- reject_regex: '^(Rejected|:-1:|Borg)'
- author_approval:
- auto: true
-
-
-groups:
- development:
- approve_by_comment:
- enabled: true
- conditions:
- branches:
- - development
- required: 2
- teams:
- - approvers
-
- master:
- approve_by_comment:
- enabled: true
- conditions:
- branches:
- - master
- required: 4
- teams:
- - approvers
diff --git a/.stickler.yml b/.stickler.yml
index b96fc2e7..0eaae8cb 100644
--- a/.stickler.yml
+++ b/.stickler.yml
@@ -1,3 +1,6 @@
linters:
shellcheck:
shell: bash
+ phpcs:
+ csslint:
+ flake8:
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 2b7fae5d..e32b500e 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,5 +1,3 @@
-_This template was created based on the work of [`udemy-dl`](https://github.com/nishad/udemy-dl/blob/master/LICENSE)._
-
# Contributors Guide
Please read and understand the contribution guide before creating an issue or pull request.
diff --git a/README.md b/README.md
index b7f4f249..77f259e6 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
Network-wide ad blocking via your own Linux hardware
-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.
+The Pi-hole[®](https://pi-hole.net/trademark-rules-and-brand-guidelines/) 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)
- **Resolute**: content is blocked in _non-browser locations_, such as ad-laden mobile apps and smart TVs
@@ -27,7 +27,7 @@ Those who want to get started quickly and conveniently, may install Pi-hole usin
#### `curl -sSL https://install.pi-hole.net | bash`
## Alternative Install Methods
-[Piping to `bash` is controversial](https://pi-hole.net/2016/07/25/curling-and-piping-to-bash), as it prevents you from [reading code that is about to run](https://github.com/pi-hole/pi-hole/blob/master/automated%20install/basic-install.sh) on your system. Therefore, we provide these alternative installation methods which allow code review before installation:
+[Piping to `bash` is controversial](https://pi-hole.net/2016/07/25/curling-and-piping-to-bash), as it prevents you from [reading code that is about to run](https://github.com/pi-hole/pi-hole/blob/master/automated%20install/basic-install.sh) on your system. Therefore, we provide these alternative installation methods which allow code review before installation:
### Method 1: Clone our repository and run
```
@@ -60,16 +60,21 @@ Make no mistake: **your support is absolutely vital to help keep us innovating!*
### Donations
Sending a donation using our links below is **extremely helpful** in offsetting a portion of our monthly expenses:
- Donate via PayPal
- Bitcoin Address: 1GKnevUnVaQM2pQieMyeHkpr8DXfkpfAtL
+- Donate via PayPal
+- [Bitcoin](https://commerce.coinbase.com/checkout/fb7facaf-bebd-46be-bb77-b358f4546763):
+3MDPzjXu2hjw5sGLJvKUi1uXbvQPzVrbpF
+- [Bitcoin Cash](https://commerce.coinbase.com/checkout/fb7facaf-bebd-46be-bb77-b358f4546763): qzqsz4aju2eecc6uhs7tus4vlwhhela24sdruf4qp5
+- [Ethereum](https://commerce.coinbase.com/checkout/fb7facaf-bebd-46be-bb77-b358f4546763): 0x79d4e90A4a0C732819526c93e21A3F1356A2FAe1
### Alternative support
-If you'd rather not donate (_which is okay!_), there are other ways you can help support us:
-
-- [Digital Ocean](http://www.digitalocean.com/?refcode=344d234950e1) affiliate link
-- [Vultr](http://www.vultr.com/?ref=7190426) affiliate link
-- [UNIXstickers.com](http://unixstickers.refr.cc/jacobs) affiliate link
-- [Pi-hole Swag Store](https://pi-hole.net/shop/)
+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_
+- [UNIXstickers.com](http://unixstickers.refr.cc/jacobs) _save $5 when you spend $9 using our affiliate link_
+- [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_
+- [Vultr](http://www.vultr.com/?ref=7190426) _affiliate link_
- Spreading the word about our software, and how you have benefited from it
### Contributing via GitHub
@@ -93,9 +98,6 @@ While we are primarily reachable on our Frequently Asked Questions
@@ -127,7 +129,7 @@ You can read our [Core Feature Breakdown](https://github.com/pi-hole/pi-hole/wik
### The Web Interface Dashboard
This [optional dashboard](https://github.com/pi-hole/AdminLTE) allows you to view stats, change settings, and configure your Pi-hole. It's the power of the Command Line Interface, with none of the learning curve!
-
+
Some notable features include:
* Mobile friendly interface
@@ -142,11 +144,11 @@ Some notable features include:
There are several ways to [access the dashboard](https://discourse.pi-hole.net/t/how-do-i-access-pi-holes-dashboard-admin-interface/3168):
1. `http:///admin/`
-2. `http:/pi.hole/admin/` (when using Pi-hole as your DNS server)
+2. `http://pi.hole/admin/` (when using Pi-hole as your DNS server)
3. `http://pi.hole/` (when using Pi-hole as your DNS server)
-## The Faster-Than-Light Engine
-The [FTL Engine](https://github.com/pi-hole/FTL) is a lightweight, purpose-built daemon used to provide statistics needed for the Web Interface, and its API can be easily integrated into your own projects. As the name implies, FTL does this all *very quickly*!
+## Faster-than-light Engine
+FTLDNS[™](https://pi-hole.net/trademark-rules-and-brand-guidelines/) is a lightweight, purpose-built daemon used to provide statistics needed for the Web Interface, and its API can be easily integrated into your own projects. As the name implies, FTLDNS does this all *very quickly*!
Some of the statistics you can integrate include:
* Total number of domains being blocked
@@ -172,31 +174,13 @@ Pi-hole being a **advertising-aware DNS/Web server**, makes use of the following
* [AdminLTE Dashboard](https://github.com/almasaeed2010/AdminLTE) - premium admin control panel based on Bootstrap 3.x
While quite outdated at this point, [this original blog post about Pi-hole](https://jacobsalmela.com/2015/06/16/block-millions-ads-network-wide-with-a-raspberry-pi-hole-2-0/) goes into **great detail** about how Pi-hole was originally setup and how it works. Syntactically, it's no longer accurate, but the same basic principles and logic still apply to Pi-hole's current state.
-
------
-
-## Pi-hole Projects
-- [The Big Blocklist Collection](https://wally3k.github.io)
-- [Docker Pi-hole container (x86 and ARM)](https://hub.docker.com/r/diginc/pi-hole/)
-- [Pi-Hole in the cloud](http://blog.codybunch.com/2015/07/28/Pi-Hole-in-the-cloud/)
-- [Pie in the Sky-Hole [A Pi-Hole in the cloud for ad-blocking via DNS]](https://dlaa.me/blog/post/skyhole)
-- [Pi-hole Enable/Disable Button](http://thetimmy.silvernight.org/pages/endisbutton/)
-- [Minibian Pi-hole](https://munkjensen.net/wiki/index.php/See_my_Pi-Hole#Minibian_Pi-hole)
-- [CHiP-hole: Network-wide Ad-blocker](https://www.hackster.io/jacobsalmela/chip-hole-network-wide-ad-blocker-98e037)
-- [Chrome Extension: Pi-Hole List Editor](https://chrome.google.com/webstore/detail/pi-hole-list-editor/hlnoeoejkllgkjbnnnhfolapllcnaglh) ([Source Code](https://github.com/packtloss/pihole-extension))
-- [Splunk: Pi-hole Visualiser](https://splunkbase.splunk.com/app/3023/)
-- [Adblocking with Pi-hole and Ubuntu 14.04 on VirtualBox](https://hbalagtas.blogspot.com.au/2016/02/adblocking-with-pi-hole-and-ubuntu-1404.html)
-- [Pi-hole stats in your Mac's menu bar](https://getbitbar.com/plugins/Network/pi-hole.1m.py)
-- [Pi-hole unRAID Template](https://forums.lime-technology.com/topic/36810-support-spants-nodered-mqtt-dashing-couchdb/)
-- [Copernicus: Windows Tray Application](https://github.com/goldbattle/copernicus)
-- [Let your blink1 device blink when Pi-hole filters ads](https://gist.github.com/elpatron68/ec0b4c582e5abf604885ac1e068d233f)
-- [Pi-hole metrics](https://github.com/nlamirault/pihole_exporter) exporter for [Prometheus](https://prometheus.io/)
-- [Magic Mirror with DNS Filtering](https://zonksec.com/blog/magic-mirror-dns-filtering/#dnssoftware)
-- [Pi-hole Droid: Android client](https://github.com/friimaind/pi-hole-droid)
-- [Windows DNS Swapper](https://github.com/roots84/DNS-Swapper), see [#1400](https://github.com/pi-hole/pi-hole/issues/1400)
-----
## Coverage
+- [Software Engineering Daily: Interview with the creator of Pi-hole](https://softwareengineeringdaily.com/2018/05/29/pi-hole-ad-blocker-hardware-with-jacob-salmela/)
+- [Bloomberg Business Week: Brotherhood of the Ad blockers](https://www.bloomberg.com/news/features/2018-05-10/inside-the-brotherhood-of-pi-hole-ad-blockers)
+- [Securing DNS across all of my devices with Pi-Hole + DNS-over-HTTPS + 1.1.1.1](https://scotthelme.co.uk/securing-dns-across-all-of-my-devices-with-pihole-dns-over-https-1-1-1-1/)
+- [Adafruit: installing Pi-hole on a Pi Zero W](https://learn.adafruit.com/pi-hole-ad-blocker-with-pi-zero-w/install-pi-hole)
- [Lifehacker: Turn A Raspberry Pi Into An Ad Blocker With A Single Command](https://www.lifehacker.com.au/2015/02/turn-a-raspberry-pi-into-an-ad-blocker-with-a-single-command/)
- [MakeUseOf: Adblock Everywhere: The Raspberry Pi-Hole Way](http://www.makeuseof.com/tag/adblock-everywhere-raspberry-pi-hole-way/)
- [Catchpoint: Ad-Blocking on Apple iOS9: Valuing the End User Experience](http://blog.catchpoint.com/2015/09/14/ad-blocking-apple/)
@@ -215,3 +199,12 @@ While quite outdated at this point, [this original blog post about Pi-hole](http
- [CryptoAUSTRALIA: How We Tried 5 Privacy Focused Raspberry Pi Projects](https://blog.cryptoaustralia.org.au/2017/10/05/5-privacy-focused-raspberry-pi-projects/)
- [CryptoAUSTRALIA: Pi-hole Workshop](https://blog.cryptoaustralia.org.au/2017/11/02/pi-hole-network-wide-ad-blocker/)
- [Know How 355: Killing ads with a Raspberry Pi-Hole!](https://www.twit.tv/shows/know-how/episodes/355)
+
+-----
+
+## Pi-hole Projects
+- [The Big Blocklist Collection](https://wally3k.github.io)
+- [Pie in the Sky-Hole](https://dlaa.me/blog/post/skyhole)
+- [Copernicus: Windows Tray Application](https://github.com/goldbattle/copernicus)
+- [Magic Mirror with DNS Filtering](https://zonksec.com/blog/magic-mirror-dns-filtering/#dnssoftware)
+- [Windows DNS Swapper](https://github.com/roots84/DNS-Swapper)
diff --git a/adlists.default b/adlists.default
deleted file mode 100644
index cbc1bfb3..00000000
--- a/adlists.default
+++ /dev/null
@@ -1,23 +0,0 @@
-# The below list amalgamates several lists we used previously.
-# See `https://github.com/StevenBlack/hosts` for details
-##StevenBlack's list
-https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
-
-##MalwareDomains
-https://mirror1.malwaredomains.com/files/justdomains
-
-##Cameleon
-http://sysctl.org/cameleon/hosts
-
-##Zeustracker
-https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist
-
-##Disconnect.me Tracking
-https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt
-
-##Disconnect.me Ads
-https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt
-
-##Hosts-file.net
-https://hosts-file.net/ad_servers.txt
-
diff --git a/advanced/Scripts/chronometer.sh b/advanced/Scripts/chronometer.sh
index 13d743a8..4bc090f2 100755
--- a/advanced/Scripts/chronometer.sh
+++ b/advanced/Scripts/chronometer.sh
@@ -179,6 +179,7 @@ get_init_stats() {
90009[2-3]|920093) sys_model=" Zero";; # 512MB
9000c1) sys_model=" Zero W";; # 512MB
a02082|a[2-3]2082) sys_model=" 3, Model B";; # 1GB
+ a020d3) sys_model=" 3, Model B+";; # 1GB
*) sys_model="";;
esac
sys_type="Raspberry Pi$sys_model"
diff --git a/advanced/Scripts/piholeCheckout.sh b/advanced/Scripts/piholeCheckout.sh
index 63198b5a..5125a2b4 100644
--- a/advanced/Scripts/piholeCheckout.sh
+++ b/advanced/Scripts/piholeCheckout.sh
@@ -17,191 +17,13 @@ source "${PI_HOLE_FILES_DIR}/automated install/basic-install.sh"
# piholeGitURL set in basic-install.sh
# is_repo() sourced from basic-install.sh
# setupVars set in basic-install.sh
+# check_download_exists sourced from basic-install.sh
+# fully_fetch_repo sourced from basic-install.sh
+# get_available_branches sourced from basic-install.sh
+# fetch_checkout_pull_branch sourced from basic-install.sh
+# checkout_pull_branch sourced from basic-install.sh
source "${setupVars}"
-update="false"
-
-coltable="/opt/pihole/COL_TABLE"
-source ${coltable}
-
-check_download_exists() {
- status=$(curl --head --silent "https://ftl.pi-hole.net/${1}" | head -n 1)
- if grep -q "404" <<< "$status"; then
- return 1
- else
- return 0
- fi
-}
-
-FTLinstall() {
- # Download and install FTL binary
- local binary
- binary="${1}"
- local path
- path="${2}"
- local str
- str="Installing FTL"
- echo -ne " ${INFO} ${str}..."
-
- if curl -sSL --fail "https://ftl.pi-hole.net/${path}" -o "/tmp/${binary}"; then
- # Get sha1 of the binary we just downloaded for verification.
- curl -sSL --fail "https://ftl.pi-hole.net/${path}.sha1" -o "/tmp/${binary}.sha1"
- # Check if we just downloaded text, or a binary file.
- cd /tmp || return 1
- if sha1sum --status --quiet -c "${binary}".sha1; then
- echo -n "transferred... "
- stop_service pihole-FTL &> /dev/null
- install -T -m 0755 "/tmp/${binary}" "/usr/bin/pihole-FTL"
- rm "/tmp/${binary}" "/tmp/${binary}.sha1"
- start_service pihole-FTL &> /dev/null
- echo -e "${OVER} ${TICK} ${str}"
- return 0
- else
- echo -e "${OVER} ${CROSS} ${str}"
- echo -e " ${COL_LIGHT_RED}Error: Download of binary from ftl.pi-hole.net failed${COL_NC}"
- return 1
- fi
- else
- echo -e "${OVER} ${CROSS} ${str}"
- echo -e " ${COL_LIGHT_RED}Error: URL not found${COL_NC}"
- fi
-}
-
-get_binary_name() {
- # This gives the machine architecture which may be different from the OS architecture...
- local machine
- machine=$(uname -m)
-
- # This gives the architecture of packages dpkg installs (for example, "i386")
- local dpkgarch
- dpkgarch=$(dpkg --print-architecture 2> /dev/null)
-
- # Special case: This is a 32 bit OS, installed on a 64 bit machine
- # -> change machine architecture to download the 32 bit executable
- if [[ "${machine}" == "x86_64" && "${dpkgarch}" == "i386" ]]; then
- machine="i686"
- fi
-
- local str
- str="Detecting architecture"
- echo -ne " ${INFO} ${str}..."
- if [[ "${machine}" == "arm"* || "${machine}" == *"aarch"* ]]; then
- # ARM
- local rev
- rev=$(uname -m | sed "s/[^0-9]//g;")
- local lib
- lib=$(ldd /bin/ls | grep -E '^\s*/lib' | awk '{ print $1 }')
- if [[ "${lib}" == "/lib/ld-linux-aarch64.so.1" ]]; then
- echo -e "${OVER} ${TICK} Detected ARM-aarch64 architecture"
- binary="pihole-FTL-aarch64-linux-gnu"
- elif [[ "${lib}" == "/lib/ld-linux-armhf.so.3" ]]; then
- if [[ "$rev" -gt "6" ]]; then
- echo -e "${OVER} ${TICK} Detected ARM-hf architecture (armv7+)"
- binary="pihole-FTL-arm-linux-gnueabihf"
- else
- echo -e "${OVER} ${TICK} Detected ARM-hf architecture (armv6 or lower) Using ARM binary"
- binary="pihole-FTL-arm-linux-gnueabi"
- fi
- else
- echo -e "${OVER} ${TICK} Detected ARM architecture"
- binary="pihole-FTL-arm-linux-gnueabi"
- fi
- elif [[ "${machine}" == "ppc" ]]; then
- # PowerPC
- echo -e "${OVER} ${TICK} Detected PowerPC architecture"
- binary="pihole-FTL-powerpc-linux-gnu"
- elif [[ "${machine}" == "x86_64" ]]; then
- # 64bit
- echo -e "${OVER} ${TICK} Detected x86_64 architecture"
- binary="pihole-FTL-linux-x86_64"
- else
- # Something else - we try to use 32bit executable and warn the user
- if [[ ! "${machine}" == "i686" ]]; then
- echo -e "${OVER} ${CROSS} ${str}...
- ${COL_LIGHT_RED}Not able to detect architecture (unknown: ${machine}), trying 32bit executable
- Contact support if you experience issues (e.g: FTL not running)${COL_NC}"
- else
- echo -e "${OVER} ${TICK} Detected 32bit (i686) architecture"
- fi
- binary="pihole-FTL-linux-x86_32"
- fi
-}
-
-fully_fetch_repo() {
- # Add upstream branches to shallow clone
- local directory="${1}"
-
- cd "${directory}" || return 1
- if is_repo "${directory}"; then
- git remote set-branches origin '*' || return 1
- git fetch --quiet || return 1
- else
- return 1
- fi
- return 0
-}
-
-get_available_branches() {
- # Return available branches
- local directory
- directory="${1}"
- local output
-
- cd "${directory}" || return 1
- # Get reachable remote branches, but store STDERR as STDOUT variable
- output=$( { git remote show origin | grep 'tracked' | sed 's/tracked//;s/ //g'; } 2>&1 )
- echo "$output"
- return
-}
-
-fetch_checkout_pull_branch() {
- # Check out specified branch
- local directory
- directory="${1}"
- local branch
- branch="${2}"
-
- # Set the reference for the requested branch, fetch, check it put and pull it
- cd "${directory}" || return 1
- git remote set-branches origin "${branch}" || return 1
- git stash --all --quiet &> /dev/null || true
- git clean --quiet --force -d || true
- git fetch --quiet || return 1
- checkout_pull_branch "${directory}" "${branch}" || return 1
-}
-
-checkout_pull_branch() {
- # Check out specified branch
- local directory
- directory="${1}"
- local branch
- branch="${2}"
- local oldbranch
-
- cd "${directory}" || return 1
-
- oldbranch="$(git symbolic-ref HEAD)"
-
- str="Switching to branch: '${branch}' from '${oldbranch}'"
- echo -ne " ${INFO} $str"
- git checkout "${branch}" --quiet || return 1
- echo -e "${OVER} ${TICK} $str"
-
-
- if [[ "$(git diff "${oldbranch}" | grep -c "^")" -gt "0" ]]; then
- update="true"
- fi
-
- git_pull=$(git pull || return 1)
-
- if [[ "$git_pull" == *"up-to-date"* ]]; then
- echo -e " ${INFO} ${git_pull}"
- else
- echo -e "$git_pull\\n"
- fi
-
- return 0
-}
warning1() {
echo " Please note that changing branches severely alters your Pi-hole subsystems"
@@ -233,7 +55,7 @@ checkout() {
Please re-run install script from https://github.com/pi-hole/pi-hole${COL_NC}"
exit 1;
fi
- if [[ "${INSTALL_WEB}" == "true" ]]; then
+ if [[ "${INSTALL_WEB_INTERFACE}" == "true" ]]; then
if ! is_repo "${webInterfaceDir}" ; then
echo -e " ${COL_LIGHT_RED}Error: Web Admin repo is missing from system!
Please re-run install script from https://github.com/pi-hole/pi-hole${COL_NC}"
@@ -257,7 +79,7 @@ checkout() {
echo ""
echo -e " ${INFO} Pi-hole Core"
fetch_checkout_pull_branch "${PI_HOLE_FILES_DIR}" "development" || { echo " ${CROSS} Unable to pull Core developement branch"; exit 1; }
- if [[ "${INSTALL_WEB}" == "true" ]]; then
+ if [[ "${INSTALL_WEB_INTERFACE}" == "true" ]]; then
echo ""
echo -e " ${INFO} Web interface"
fetch_checkout_pull_branch "${webInterfaceDir}" "devel" || { echo " ${CROSS} Unable to pull Web development branch"; exit 1; }
@@ -267,13 +89,13 @@ checkout() {
get_binary_name
local path
path="development/${binary}"
- FTLinstall "${binary}" "${path}"
+ echo "development" > /etc/pihole/ftlbranch
elif [[ "${1}" == "master" ]] ; then
# Shortcut to check out master branches
echo -e " ${INFO} Shortcut \"master\" detected - checking out master branches..."
echo -e " ${INFO} Pi-hole core"
fetch_checkout_pull_branch "${PI_HOLE_FILES_DIR}" "master" || { echo " ${CROSS} Unable to pull Core master branch"; exit 1; }
- if [[ ${INSTALL_WEB} == "true" ]]; then
+ if [[ ${INSTALL_WEB_INTERFACE} == "true" ]]; then
echo -e " ${INFO} Web interface"
fetch_checkout_pull_branch "${webInterfaceDir}" "master" || { echo " ${CROSS} Unable to pull Web master branch"; exit 1; }
fi
@@ -281,7 +103,7 @@ checkout() {
get_binary_name
local path
path="master/${binary}"
- FTLinstall "${binary}" "${path}"
+ echo "master" > /etc/pihole/ftlbranch
elif [[ "${1}" == "core" ]] ; then
str="Fetching branches from ${piholeGitUrl}"
echo -ne " ${INFO} $str"
@@ -309,7 +131,7 @@ checkout() {
exit 1
fi
checkout_pull_branch "${PI_HOLE_FILES_DIR}" "${2}"
- elif [[ "${1}" == "web" ]] && [[ "${INSTALL_WEB}" == "true" ]] ; then
+ elif [[ "${1}" == "web" ]] && [[ "${INSTALL_WEB_INTERFACE}" == "true" ]] ; then
str="Fetching branches from ${webInterfaceGitUrl}"
echo -ne " ${INFO} $str"
if ! fully_fetch_repo "${webInterfaceDir}" ; then
@@ -343,7 +165,10 @@ checkout() {
if check_download_exists "$path"; then
echo " ${TICK} Branch ${2} exists"
- FTLinstall "${binary}" "${path}"
+ echo "${2}" > /etc/pihole/ftlbranch
+ FTLinstall "${binary}"
+ start_service pihole-FTL
+ enable_service pihole-FTL
else
echo " ${CROSS} Requested branch \"${2}\" is not available"
ftlbranches=( $(git ls-remote https://github.com/pi-hole/ftl | grep 'heads' | sed 's/refs\/heads\///;s/ //g' | awk '{print $2}') )
@@ -358,7 +183,7 @@ checkout() {
fi
# Force updating everything
- if [[ ( ! "${1}" == "web" && ! "${1}" == "ftl" ) && "${update}" == "true" ]]; then
+ if [[ ! "${1}" == "web" && ! "${1}" == "ftl" ]]; then
echo -e " ${INFO} Running installer to upgrade your installation"
if "${PI_HOLE_FILES_DIR}/automated install/basic-install.sh" --unattended; then
exit 0
diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh
index b668af94..a7fa4c2a 100755
--- a/advanced/Scripts/piholeDebug.sh
+++ b/advanced/Scripts/piholeDebug.sh
@@ -465,15 +465,15 @@ processor_check() {
else
# Check if the architecture is currently supported for FTL
case "${PROCESSOR}" in
- "amd64") "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}"
+ "amd64") log_write "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}"
;;
- "armv6l") "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}"
+ "armv6l") log_write "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}"
;;
- "armv6") "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}"
+ "armv6") log_write "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}"
;;
- "armv7l") "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}"
+ "armv7l") log_write "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}"
;;
- "aarch64") "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}"
+ "aarch64") log_write "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}"
;;
# Otherwise, show the processor type
*) log_write "${INFO} ${PROCESSOR}";
@@ -493,6 +493,13 @@ parse_setup_vars() {
fi
}
+parse_locale() {
+ local pihole_locale
+ echo_current_diagnostic "Locale"
+ pihole_locale="$(locale)"
+ parse_file "${pihole_locale}"
+}
+
does_ip_match_setup_vars() {
# Check for IPv4 or 6
local protocol="${1}"
@@ -592,7 +599,7 @@ ping_gateway() {
# Try to quietly ping the gateway 3 times, with a timeout of 3 seconds, using numeric output only,
# on the pihole interface, and tail the last three lines of the output
# If pinging the gateway is not successful,
- if ! ${cmd} -c 3 -W 2 -n ${gateway} -I ${PIHOLE_INTERFACE} >/dev/null; then
+ if ! ${cmd} -c 1 -W 2 -n ${gateway} -I ${PIHOLE_INTERFACE} >/dev/null; then
# let the user know
log_write "${CROSS} ${COL_RED}Gateway did not respond.${COL_NC} ($FAQ_GATEWAY)\n"
# and return an error code
@@ -613,7 +620,7 @@ ping_internet() {
ping_ipv4_or_ipv6 "${protocol}"
log_write "* Checking Internet connectivity via IPv${protocol}..."
# Try to ping the address 3 times
- if ! ${cmd} -W 2 -c 3 -n ${public_address} -I ${PIHOLE_INTERFACE} >/dev/null; then
+ if ! ${cmd} -c 1 -W 2 -n ${public_address} -I ${PIHOLE_INTERFACE} >/dev/null; then
# if it's unsuccessful, show an error
log_write "${CROSS} ${COL_RED}Cannot reach the Internet.${COL_NC}\n"
return 1
@@ -652,15 +659,22 @@ check_required_ports() {
# Sort the addresses and remove duplicates
while IFS= read -r line; do
ports_in_use+=( "$line" )
- done < <( lsof -i -P -n | awk -F' ' '/LISTEN/ {print $9, $1}' | sort -n | uniq | cut -d':' -f2 )
+ done < <( lsof -iTCP -sTCP:LISTEN -P -n +c 10 )
# Now that we have the values stored,
for i in "${!ports_in_use[@]}"; do
# loop through them and assign some local variables
- local port_number
- port_number="$(echo "${ports_in_use[$i]}" | awk '{print $1}')"
local service_name
- service_name=$(echo "${ports_in_use[$i]}" | awk '{print $2}')
+ service_name=$(echo "${ports_in_use[$i]}" | awk '{print $1}')
+ local protocol_type
+ protocol_type=$(echo "${ports_in_use[$i]}" | awk '{print $5}')
+ local port_number
+ port_number="$(echo "${ports_in_use[$i]}" | awk '{print $9}')"
+
+ # Skip the line if it's the titles of the columns the lsof command produces
+ if [[ "${service_name}" == COMMAND ]]; then
+ continue
+ fi
# Use a case statement to determine if the right services are using the right ports
case "${port_number}" in
53) compare_port_to_service_assigned "${resolver}"
@@ -670,7 +684,7 @@ check_required_ports() {
4711) compare_port_to_service_assigned "${ftl}"
;;
# If it's not a default port that Pi-hole needs, just print it out for the user to see
- *) log_write "[${port_number}] is in use by ${service_name}";
+ *) log_write "${port_number} ${service_name} (${protocol_type})";
esac
done
}
@@ -712,20 +726,20 @@ check_x_headers() {
# If the X-header found by curl matches what is should be,
if [[ $block_page == "$block_page_working" ]]; then
# display a success message
- log_write "$TICK ${COL_GREEN}${block_page}${COL_NC}"
+ log_write "$TICK Block page X-Header: ${COL_GREEN}${block_page}${COL_NC}"
else
# Otherwise, show an error
- log_write "$CROSS ${COL_RED}X-Header does not match or could not be retrieved.${COL_NC}"
+ log_write "$CROSS Block page X-Header: ${COL_RED}X-Header does not match or could not be retrieved.${COL_NC}"
log_write "${COL_RED}${full_curl_output_block_page}${COL_NC}"
fi
# Same logic applies to the dashbord as above, if the X-Header matches what a working system shoud have,
if [[ $dashboard == "$dashboard_working" ]]; then
# then we can show a success
- log_write "$TICK ${COL_GREEN}${dashboard}${COL_NC}"
+ log_write "$TICK Web interface X-Header: ${COL_GREEN}${dashboard}${COL_NC}"
else
# Othewise, it's a failure since the X-Headers either don't exist or have been modified in some way
- log_write "$CROSS ${COL_RED}X-Header does not match or could not be retrieved.${COL_NC}"
+ log_write "$CROSS Web interface X-Header: ${COL_RED}X-Header does not match or could not be retrieved.${COL_NC}"
log_write "${COL_RED}${full_curl_output_dashboard}${COL_NC}"
fi
}
@@ -879,8 +893,11 @@ parse_file() {
# Put the current Internal Field Separator into another variable so it can be restored later
OLD_IFS="$IFS"
# Get the lines that are in the file(s) and store them in an array for parsing later
- IFS=$'\r\n' command eval 'file_info=( $(cat "${filename}") )'
-
+ if [[ -f "$filename" ]]; then
+ IFS=$'\r\n' command eval 'file_info=( $(cat "${filename}") )'
+ else
+ read -a file_info <<< $filename
+ fi
# Set a named variable for better readability
local file_lines
# For each line in the file,
@@ -958,7 +975,7 @@ list_files_in_dir() {
"${PIHOLE_WEB_SERVER_ERROR_LOG_FILE}") make_array_from_file "${dir_to_parse}/${each_file}" 25
;;
# Same for the FTL log
- "${PIHOLE_FTL_LOG}") make_array_from_file "${dir_to_parse}/${each_file}" 25
+ "${PIHOLE_FTL_LOG}") head_tail_log "${dir_to_parse}/${each_file}" 35
;;
# parse the file into an array in case we ever need to analyze it line-by-line
*) make_array_from_file "${dir_to_parse}/${each_file}";
@@ -991,6 +1008,34 @@ show_content_of_pihole_files() {
show_content_of_files_in_dir "${LOG_DIRECTORY}"
}
+head_tail_log() {
+ # The file being processed
+ local filename="${1}"
+ # The number of lines to use for head and tail
+ local qty="${2}"
+ local head_line
+ local tail_line
+ # Put the current Internal Field Separator into another variable so it can be restored later
+ OLD_IFS="$IFS"
+ # Get the lines that are in the file(s) and store them in an array for parsing later
+ IFS=$'\r\n'
+ local log_head=()
+ log_head=( $(head -n ${qty} ${filename}) )
+ log_write " ${COL_CYAN}-----head of $(basename ${filename})------${COL_NC}"
+ for head_line in "${log_head[@]}"; do
+ log_write " ${head_line}"
+ done
+ log_write ""
+ local log_tail=()
+ log_tail=( $(tail -n ${qty} ${filename}) )
+ log_write " ${COL_CYAN}-----tail of $(basename ${filename})------${COL_NC}"
+ for tail_line in "${log_tail[@]}"; do
+ log_write " ${tail_line}"
+ done
+ # Set the IFS back to what it was
+ IFS="$OLD_IFS"
+}
+
analyze_gravity_list() {
echo_current_diagnostic "Gravity list"
local head_line
@@ -1165,6 +1210,7 @@ parse_setup_vars
check_x_headers
analyze_gravity_list
show_content_of_pihole_files
+parse_locale
analyze_pihole_log
copy_to_debug_log
upload_to_tricorder
diff --git a/advanced/Scripts/piholeLogFlush.sh b/advanced/Scripts/piholeLogFlush.sh
index 5fd9832e..44af77a6 100755
--- a/advanced/Scripts/piholeLogFlush.sh
+++ b/advanced/Scripts/piholeLogFlush.sh
@@ -16,7 +16,10 @@ source ${colfile}
# Constructed to return nothing when
# a) the setting is not present in the config file, or
# b) the setting is commented out (e.g. "#DBFILE=...")
-DBFILE="$(sed -n -e 's/^\s^.DBFILE\s*=\s*//p' /etc/pihole/pihole-FTL.conf)"
+FTLconf="/etc/pihole/pihole-FTL.conf"
+if [ -e "$FTLconf" ]; then
+ DBFILE="$(sed -n -e 's/^\s*DBFILE\s*=\s*//p' ${FTLconf})"
+fi
# Test for empty string. Use standard path in this case.
if [ -z "$DBFILE" ]; then
DBFILE="/etc/pihole/pihole-FTL.db"
diff --git a/advanced/Scripts/update.sh b/advanced/Scripts/update.sh
index a4ada4c8..2279d9c7 100755
--- a/advanced/Scripts/update.sh
+++ b/advanced/Scripts/update.sh
@@ -19,6 +19,9 @@ readonly PI_HOLE_FILES_DIR="/etc/.pihole"
# shellcheck disable=SC2034
PH_TEST=true
+# when --check-only is passed to this script, it will not perform the actual update
+CHECK_ONLY=false
+
# shellcheck disable=SC1090
source "${PI_HOLE_FILES_DIR}/automated install/basic-install.sh"
# shellcheck disable=SC1091
@@ -28,9 +31,12 @@ source "/opt/pihole/COL_TABLE"
# make_repo() sourced from basic-install.sh
# update_repo() source from basic-install.sh
# getGitFiles() sourced from basic-install.sh
+# get_binary_name() sourced from basic-install.sh
+# FTLcheckUpdate() sourced from basic-install.sh
GitCheckUpdateAvail() {
- local directory="${1}"
+ local directory
+ directory="${1}"
curdir=$PWD
cd "${directory}" || return
@@ -77,24 +83,16 @@ GitCheckUpdateAvail() {
fi
}
-FTLcheckUpdate() {
- local FTLversion
- FTLversion=$(/usr/bin/pihole-FTL tag)
- local FTLlatesttag
- FTLlatesttag=$(curl -sI https://github.com/pi-hole/FTL/releases/latest | grep 'Location' | awk -F '/' '{print $NF}' | tr -d '\r\n')
-
- if [[ "${FTLversion}" != "${FTLlatesttag}" ]]; then
- return 0
- else
- return 1
- fi
-}
-
main() {
- local pihole_version_current
- local web_version_current
local basicError="\\n ${COL_LIGHT_RED}Unable to complete update, please contact Pi-hole Support${COL_NC}"
-
+ local core_update
+ local web_update
+ local FTL_update
+
+ core_update=false
+ web_update=false
+ FTL_update=false
+
# shellcheck disable=1090,2154
source "${setupVars}"
@@ -115,25 +113,7 @@ main() {
echo -e " ${INFO} Pi-hole Core:\\t${COL_LIGHT_GREEN}up to date${COL_NC}"
fi
- if FTLcheckUpdate ; then
- FTL_update=true
- echo -e " ${INFO} FTL:\\t\\t${COL_YELLOW}update available${COL_NC}"
- else
- FTL_update=false
- echo -e " ${INFO} FTL:\\t\\t${COL_LIGHT_GREEN}up to date${COL_NC}"
- fi
-
- # Logic: Don't update FTL when there is a core update available
- # since the core update will run the installer which will itself
- # re-install (i.e. update) FTL
- if ${FTL_update} && ! ${core_update}; then
- echo ""
- echo -e " ${INFO} FTL out of date"
- FTLdetect
- echo ""
- fi
-
- if [[ "${INSTALL_WEB}" == true ]]; then
+ if [[ "${INSTALL_WEB_INTERFACE}" == true ]]; then
if ! is_repo "${ADMIN_INTERFACE_DIR}" ; then
echo -e "\\n ${COL_LIGHT_RED}Error: Web Admin repo is missing from system!
Please re-run install script from https://pi-hole.net${COL_NC}"
@@ -147,82 +127,65 @@ main() {
web_update=false
echo -e " ${INFO} Web Interface:\\t${COL_LIGHT_GREEN}up to date${COL_NC}"
fi
-
- # Logic
- # If Core up to date AND web up to date:
- # Do nothing
- # If Core up to date AND web NOT up to date:
- # Pull web repo
- # If Core NOT up to date AND web up to date:
- # pull pihole repo, run install --unattended -- reconfigure
- # if Core NOT up to date AND web NOT up to date:
- # pull pihole repo run install --unattended
-
- if ! ${core_update} && ! ${web_update} ; then
- if ! ${FTL_update} ; then
- echo ""
- echo -e " ${TICK} Everything is up to date!"
- exit 0
- fi
- elif ! ${core_update} && ${web_update} ; then
- echo ""
- echo -e " ${INFO} Pi-hole Web Admin files out of date"
- getGitFiles "${ADMIN_INTERFACE_DIR}" "${ADMIN_INTERFACE_GIT_URL}"
- elif ${core_update} && ! ${web_update} ; then
- echo ""
- echo -e " ${INFO} Pi-hole core files out of date"
- getGitFiles "${PI_HOLE_FILES_DIR}" "${PI_HOLE_GIT_URL}"
- ${PI_HOLE_FILES_DIR}/automated\ install/basic-install.sh --reconfigure --unattended || \
- echo -e "${basicError}" && exit 1
- elif ${core_update} && ${web_update} ; then
- echo ""
- echo -e " ${INFO} Updating Pi-hole core and web admin files"
- getGitFiles "${PI_HOLE_FILES_DIR}" "${PI_HOLE_GIT_URL}"
- ${PI_HOLE_FILES_DIR}/automated\ install/basic-install.sh --unattended || \
- echo -e "${basicError}" && exit 1
- else
- echo -e " ${COL_LIGHT_RED}Update script has malfunctioned, please contact Pi-hole Support${COL_NC}"
- exit 1
- fi
- else # Web Admin not installed, so only verify if core is up to date
- if ! ${core_update}; then
- if ! ${FTL_update} ; then
- echo ""
- echo -e " ${INFO} Everything is up to date!"
- exit 0
- fi
- else
- echo ""
- echo -e " ${INFO} Pi-hole Core files out of date"
- getGitFiles "${PI_HOLE_FILES_DIR}" "${PI_HOLE_GIT_URL}"
- ${PI_HOLE_FILES_DIR}/automated\ install/basic-install.sh --reconfigure --unattended || \
- echo -e "${basicError}" && exit 1
- fi
fi
- if [[ "${web_update}" == true ]]; then
- web_version_current="$(/usr/local/bin/pihole version --admin --current)"
+ if FTLcheckUpdate > /dev/null; then
+ FTL_update=true
+ echo -e " ${INFO} FTL:\\t\\t${COL_YELLOW}update available${COL_NC}"
+ else
+ case $? in
+ 1)
+ echo -e " ${INFO} FTL:\\t\\t${COL_LIGHT_GREEN}up to date${COL_NC}"
+ ;;
+ 2)
+ echo -e " ${INFO} FTL:\\t\\t${COL_LIGHT_RED}Branch is not available.${COL_NC}\\n\\t\\t\\tUse ${COL_LIGHT_GREEN}pihole checkout ftl [branchname]${COL_NC} to switch to a valid branch."
+ ;;
+ *)
+ echo -e " ${INFO} FTL:\\t\\t${COL_LIGHT_RED}Something has gone wrong, contact support${COL_NC}"
+ esac
+ FTL_update=false
+ fi
+
+ if [[ "${core_update}" == false && "${web_update}" == false && "${FTL_update}" == false ]]; then
echo ""
- echo -e " ${INFO} Web Admin version is now at ${web_version_current/* v/v}
- ${INFO} If you had made any changes in '/var/www/html/admin/', they have been stashed using 'git stash'"
+ echo -e " ${TICK} Everything is up to date!"
+ exit 0
+ fi
+
+ if [[ "${CHECK_ONLY}" == true ]]; then
+ echo ""
+ exit 0
fi
if [[ "${core_update}" == true ]]; then
- pihole_version_current="$(/usr/local/bin/pihole version --pihole --current)"
echo ""
- echo -e " ${INFO} Pi-hole version is now at ${pihole_version_current/* v/v}
- ${INFO} If you had made any changes in '/etc/.pihole/', they have been stashed using 'git stash'"
+ echo -e " ${INFO} Pi-hole core files out of date, updating local repo."
+ getGitFiles "${PI_HOLE_FILES_DIR}" "${PI_HOLE_GIT_URL}"
+ echo -e " ${INFO} If you had made any changes in '/etc/.pihole/', they have been stashed using 'git stash'"
+ fi
+
+ if [[ "${web_update}" == true ]]; then
+ echo ""
+ echo -e " ${INFO} Pi-hole Web Admin files out of date, updating local repo."
+ getGitFiles "${ADMIN_INTERFACE_DIR}" "${ADMIN_INTERFACE_GIT_URL}"
+ echo -e " ${INFO} If you had made any changes in '/var/www/html/admin/', they have been stashed using 'git stash'"
fi
if [[ "${FTL_update}" == true ]]; then
- FTL_version_current="$(/usr/bin/pihole-FTL tag)"
- echo -e "\\n ${INFO} FTL version is now at ${FTL_version_current/* v/v}"
- start_service pihole-FTL
- enable_service pihole-FTL
+ echo ""
+ echo -e " ${INFO} FTL out of date, it will be updated by the installer."
fi
+ if [[ "${FTL_update}" == true || "${core_update}" == true ]]; then
+ ${PI_HOLE_FILES_DIR}/automated\ install/basic-install.sh --reconfigure --unattended || \
+ echo -e "${basicError}" && exit 1
+ fi
echo ""
exit 0
}
+if [[ "$1" == "--check-only" ]]; then
+ CHECK_ONLY=true
+fi
+
main
diff --git a/advanced/Scripts/webpage.sh b/advanced/Scripts/webpage.sh
index 5eb35e97..48161604 100755
--- a/advanced/Scripts/webpage.sh
+++ b/advanced/Scripts/webpage.sh
@@ -13,6 +13,7 @@
readonly setupVars="/etc/pihole/setupVars.conf"
readonly dnsmasqconfig="/etc/dnsmasq.d/01-pihole.conf"
readonly dhcpconfig="/etc/dnsmasq.d/02-pihole-dhcp.conf"
+readonly FTLconf="/etc/pihole/pihole-FTL.conf"
# 03 -> wildcards
readonly dhcpstaticconfig="/etc/dnsmasq.d/04-pihole-static-dhcp.conf"
@@ -35,7 +36,7 @@ Options:
-e, email Set an administrative contact address for the Block Page
-h, --help Show this help dialog
-i, interface Specify dnsmasq's interface listening behavior
- Add '-h' for more info on interface usage"
+ -l, privacylevel Set privacy level (0 = lowest, 3 = highest)"
exit 0
}
@@ -52,6 +53,19 @@ change_setting() {
add_setting "${1}" "${2}"
}
+addFTLsetting() {
+ echo "${1}=${2}" >> "${FTLconf}"
+}
+
+deleteFTLsetting() {
+ sed -i "/${1}/d" "${FTLconf}"
+}
+
+changeFTLsetting() {
+ deleteFTLsetting "${1}"
+ addFTLsetting "${1}" "${2}"
+}
+
add_dnsmasq_setting() {
if [[ "${2}" != "" ]]; then
echo "${1}=${2}" >> "${dnsmasqconfig}"
@@ -135,6 +149,14 @@ ProcessDNSSettings() {
let COUNTER=COUNTER+1
done
+ # The option LOCAL_DNS_PORT is deprecated
+ # We apply it once more, and then convert it into the current format
+ if [ ! -z "${LOCAL_DNS_PORT}" ]; then
+ add_dnsmasq_setting "server" "127.0.0.1#${LOCAL_DNS_PORT}"
+ add_setting "PIHOLE_DNS_${COUNTER}" "127.0.0.1#${LOCAL_DNS_PORT}"
+ delete_setting "LOCAL_DNS_PORT"
+ fi
+
delete_dnsmasq_setting "domain-needed"
if [[ "${DNS_FQDN_REQUIRED}" == true ]]; then
@@ -182,10 +204,6 @@ trust-anchor=.,20326,8,2,E06D44B80B8F1D39A95C0B0D7C65D08458E880409BBC68345710423
add_dnsmasq_setting "interface" "${PIHOLE_INTERFACE}"
fi
- if [[ "${CONDITIONAL_FORWARDING}" == true ]]; then
- add_dnsmasq_setting "server=/${CONDITIONAL_FORWARDING_DOMAIN}/${CONDITIONAL_FORWARDING_IP}"
- add_dnsmasq_setting "server=/${CONDITIONAL_FORWARDING_REVERSE}/${CONDITIONAL_FORWARDING_IP}"
- fi
}
@@ -215,17 +233,6 @@ SetDNSServers() {
else
change_setting "DNSSEC" "false"
fi
- if [[ "${args[6]}" == "conditional_forwarding" ]]; then
- change_setting "CONDITIONAL_FORWARDING" "true"
- change_setting "CONDITIONAL_FORWARDING_IP" "${args[7]}"
- change_setting "CONDITIONAL_FORWARDING_DOMAIN" "${args[8]}"
- change_setting "CONDITIONAL_FORWARDING_REVERSE" "${args[9]}"
- else
- change_setting "CONDITIONAL_FORWARDING" "false"
- delete_setting "CONDITIONAL_FORWARDING_IP"
- delete_setting "CONDITIONAL_FORWARDING_DOMAIN"
- delete_setting "CONDITIONAL_FORWARDING_REVERSE"
- fi
ProcessDNSSettings
@@ -361,7 +368,9 @@ CustomizeAdLists() {
elif [[ "${args[2]}" == "disable" ]]; then
sed -i "\\@${args[3]}@s/^http/#http/g" "${list}"
elif [[ "${args[2]}" == "add" ]]; then
- echo "${args[3]}" >> ${list}
+ if [[ $(grep -c "^${args[3]}$" "${list}") -eq 0 ]] ; then
+ echo "${args[3]}" >> ${list}
+ fi
elif [[ "${args[2]}" == "del" ]]; then
var=$(echo "${args[3]}" | sed 's/\//\\\//g')
sed -i "/${var}/Id" "${list}"
@@ -505,36 +514,44 @@ audit()
echo "${args[2]}" >> /etc/pihole/auditlog.list
}
+SetPrivacyLevel() {
+ # Set privacy level. Minimum is 0, maximum is 3
+ if [ "${args[2]}" -ge 0 ] && [ "${args[2]}" -le 3 ]; then
+ changeFTLsetting "PRIVACYLEVEL" "${args[2]}"
+ fi
+}
+
main() {
args=("$@")
case "${args[1]}" in
- "-p" | "password" ) SetWebPassword;;
- "-c" | "celsius" ) unit="C"; SetTemperatureUnit;;
- "-f" | "fahrenheit" ) unit="F"; SetTemperatureUnit;;
- "-k" | "kelvin" ) unit="K"; SetTemperatureUnit;;
- "setdns" ) SetDNSServers;;
- "setexcludedomains" ) SetExcludeDomains;;
- "setexcludeclients" ) SetExcludeClients;;
- "poweroff" ) Poweroff;;
- "reboot" ) Reboot;;
- "restartdns" ) RestartDNS;;
- "setquerylog" ) SetQueryLogOptions;;
- "enabledhcp" ) EnableDHCP;;
- "disabledhcp" ) DisableDHCP;;
- "layout" ) SetWebUILayout;;
- "-h" | "--help" ) helpFunc;;
- "privacymode" ) SetPrivacyMode;;
- "resolve" ) ResolutionSettings;;
- "addstaticdhcp" ) AddDHCPStaticAddress;;
- "removestaticdhcp" ) RemoveDHCPStaticAddress;;
- "-r" | "hostrecord" ) SetHostRecord "$3";;
- "-e" | "email" ) SetAdminEmail "$3";;
- "-i" | "interface" ) SetListeningMode "$@";;
- "-t" | "teleporter" ) Teleporter;;
- "adlist" ) CustomizeAdLists;;
- "audit" ) audit;;
- * ) helpFunc;;
+ "-p" | "password" ) SetWebPassword;;
+ "-c" | "celsius" ) unit="C"; SetTemperatureUnit;;
+ "-f" | "fahrenheit" ) unit="F"; SetTemperatureUnit;;
+ "-k" | "kelvin" ) unit="K"; SetTemperatureUnit;;
+ "setdns" ) SetDNSServers;;
+ "setexcludedomains" ) SetExcludeDomains;;
+ "setexcludeclients" ) SetExcludeClients;;
+ "poweroff" ) Poweroff;;
+ "reboot" ) Reboot;;
+ "restartdns" ) RestartDNS;;
+ "setquerylog" ) SetQueryLogOptions;;
+ "enabledhcp" ) EnableDHCP;;
+ "disabledhcp" ) DisableDHCP;;
+ "layout" ) SetWebUILayout;;
+ "-h" | "--help" ) helpFunc;;
+ "privacymode" ) SetPrivacyMode;;
+ "resolve" ) ResolutionSettings;;
+ "addstaticdhcp" ) AddDHCPStaticAddress;;
+ "removestaticdhcp" ) RemoveDHCPStaticAddress;;
+ "-r" | "hostrecord" ) SetHostRecord "$3";;
+ "-e" | "email" ) SetAdminEmail "$3";;
+ "-i" | "interface" ) SetListeningMode "$@";;
+ "-t" | "teleporter" ) Teleporter;;
+ "adlist" ) CustomizeAdLists;;
+ "audit" ) audit;;
+ "-l" | "privacylevel" ) SetPrivacyLevel;;
+ * ) helpFunc;;
esac
shift
diff --git a/advanced/index.php b/advanced/index.php
index 14da9ecf..1575bafc 100644
--- a/advanced/index.php
+++ b/advanced/index.php
@@ -64,7 +64,7 @@ if ($serverName === "pi.hole") {
$viewPort
- Pi-hole: Your black hole for Internet advertisements
+ Pi-hole: Your black hole for Internet advertisements Did you mean to go to the admin panel?