net/safe-search: Fix double installation bug 7645/head
authorGregory L. Dietsche <gregory.dietsche@cuw.edu>
Wed, 12 Dec 2018 17:02:05 +0000 (11:02 -0600)
committerGregory L. Dietsche <gregory.dietsche@cuw.edu>
Wed, 12 Dec 2018 17:28:39 +0000 (11:28 -0600)
If safe search is built directly into an image, the /etc/config/dhcp
file will have multiple entries added to it after using sysupgrade
for the nth time (2 or more sysupgrade cycles).

In /etc/config/dhcp, this bug creates duplicate entries like this:

config dnsmasq
list addnhosts '/etc/safe-search/enabled'
list addnhosts '/etc/safe-search/enabled'

This patch ensures that safe search only registers itself one time.

Signed-off-by: Gregory L. Dietsche <gregory.dietsche@cuw.edu>
net/safe-search/Makefile
net/safe-search/files/safe-search.defaults

index 4676c214406293ca32e2b3c4d5a624ef192a292c..1a89901216b5e0b8fefea125a1aab3b314e548bf 100644 (file)
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=safe-search
 PKG_VERSION:=1.0.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_LICENSE:=MIT
 PKG_MAINTAINER:=Gregory L. Dietsche <Gregory.Dietsche@cuw.edu>
 
index a2158aaacb429a73f85176ab1e67c217c4fc9e14..d72399d7ca066b5b2ca1ea06cc54811ae494f1e7 100644 (file)
@@ -3,6 +3,7 @@
 # Copyright (c) 2018 Gregory L. Dietsche <Gregory.Dietsche@cuw.edu>
 # This is free software, licensed under the MIT License
 #
+uci del_list dhcp.@dnsmasq[0].addnhosts=/etc/safe-search/enabled
 uci add_list dhcp.@dnsmasq[0].addnhosts=/etc/safe-search/enabled
 uci commit dhcp