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>
13 lines
388 B
Bash
13 lines
388 B
Bash
#!/bin/sh
|
|
#
|
|
# 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
|
|
|
|
#/etc/init.d/dnsmasq reload #safe-search-update does this for us.
|
|
/usr/sbin/safe-search-update
|
|
|
|
exit 0
|