Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/pi-hole/pi-hole.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Ghiot <ghiot.pierre@gmail.com>2019-10-27 03:07:08 +0300
committerMograine <ghiot.pierre@gmail.com>2019-10-27 18:55:54 +0300
commitf9d16c2b1525a9dde136be5968583a56723b3a7d (patch)
tree7fdcad79f61a7982dfee2f106969b34dcb83c428 /advanced
parente41c4b5bb691cea1f5b950d39518d8c404b5846e (diff)
Update webpage.sh
Signed-off-by: Mograine <ghiot.pierre@gmail.com>
Diffstat (limited to 'advanced')
-rwxr-xr-xadvanced/Scripts/webpage.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/advanced/Scripts/webpage.sh b/advanced/Scripts/webpage.sh
index 600a45a5..e990cc22 100755
--- a/advanced/Scripts/webpage.sh
+++ b/advanced/Scripts/webpage.sh
@@ -17,6 +17,7 @@ readonly FTLconf="/etc/pihole/pihole-FTL.conf"
# 03 -> wildcards
readonly dhcpstaticconfig="/etc/dnsmasq.d/04-pihole-static-dhcp.conf"
readonly PI_HOLE_BIN_DIR="/usr/local/bin"
+readonly dnscustomfile="/etc/pihole/custom.list"
coltable="/opt/pihole/COL_TABLE"
if [[ -f ${coltable} ]]; then
@@ -564,6 +565,17 @@ SetPrivacyLevel() {
fi
}
+AddCustomDNSAddress() {
+ ip="${args[2]}"
+ host="${args[3]}"
+ echo "${ip} ${host}" >> "${dnscustomfile}"
+}
+
+RemoveCustomDNSAddress() {
+ host="${args[2]}"
+ sed -i "/.*${host}/d" "${dnscustomfile}"
+}
+
main() {
args=("$@")
@@ -595,6 +607,8 @@ main() {
"audit" ) addAudit "$@";;
"clearaudit" ) clearAudit;;
"-l" | "privacylevel" ) SetPrivacyLevel;;
+ "addcustomdns" ) AddCustomDNSAddress;;
+ "removecustomdns" ) RemoveCustomDNSAddress;;
* ) helpFunc;;
esac