0
0
mirror of https://github.com/openwrt/packages.git synced 2025-01-31 04:51:44 +00:00
packages/net/safe-search/files/safe-search-update
Gregory L. Dietsche ed6c58b84d net/safe-search: new package
This package forces the use of Google and Bing safe search by default.
It does this by adding hosts files for dnsmasq to use. These hosts replace the
normal IP addresses for Google and Bing with addresses that force safe
search to be turned on all the time.

Google and Bing Safe Search are suitable for most businesses, schools, and
families who wish to block adult content. This package also offers
YouTube's restricted and 'restricted moderate' via a configuration
option. The reason that this is not enabled is that it is probably more
suitable for children rather than a wide audience.

This package is designed so that other services that offer safe search can be
added easily in the future.

For more information about safe search please visit these URLs:
- https://support.google.com/websearch/answer/186669
- https://help.bing.microsoft.com/#apex/18/en-US/10003/0
- https://support.google.com/a/answer/6212415

Signed-off-by: Gregory L. Dietsche <gregory.dietsche@cuw.edu>
2018-10-18 10:12:18 +08:00

24 lines
676 B
Bash

#!/bin/sh
#
# Copyright (c) 2018 Gregory L. Dietsche <Gregory.Dietsche@cuw.edu>
# This is free software, licensed under the MIT License
#
. /lib/functions.sh
update() {
config_get_bool enabled $1 enabled 0
config_get mode $1 mode default
if [ ! -f /etc/safe-search/available/$1.$mode ]; then
echo Error: /etc/safe-search/available/$1.$mode does not exist. Please check your configuration in /etc/config/safe-search
else
if [ "$enabled" -eq 1 ]; then
ln -s /etc/safe-search/available/$1.$mode /etc/safe-search/enabled/
fi
fi
}
rm -f /etc/safe-search/enabled/*
config_load 'safe-search'
config_foreach update safe-search
/etc/init.d/dnsmasq reload