mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
parental-control: use apps partition to store bundle related files
This commit is contained in:
parent
1337ba6d57
commit
078d7f237c
4 changed files with 12 additions and 10 deletions
|
|
@ -83,14 +83,13 @@ start_service() {
|
|||
config_load parentalcontrol
|
||||
validate_global_section
|
||||
|
||||
[ -n "${bundle_path}" ] && mkdir -p ${bundle_path}
|
||||
|
||||
# add default bundles
|
||||
process_default_bundles
|
||||
# add firewall rules
|
||||
configure_fw_rules
|
||||
|
||||
if [ "${urlfilter}" -eq "1" ]; then
|
||||
if [ "${urlfilter}" -eq "1" ] && [ -d "/apps" ]; then
|
||||
# add default bundles
|
||||
[ -n "${bundle_path}" ] && mkdir -p ${bundle_path}
|
||||
process_default_bundles
|
||||
enable_urlfilter_dm
|
||||
else
|
||||
disable_urlfilter_dm
|
||||
|
|
@ -100,7 +99,7 @@ start_service() {
|
|||
# then /tmp/dhcp.leases will be empty until clients try to get a lease,
|
||||
# in that case, hostnames will not be processed by the daemon,
|
||||
# for this we copy /tmp/dhcp.leases to /etc/parentalcontrol/dhcp.leases
|
||||
# which will be persistent acrros reboots and upgrade where settings are kept
|
||||
# which will be persistent across reboots and upgrade (with keep settings)
|
||||
# and will be used as a backup in case /tmp/dhcp.leases is empty
|
||||
copy_dhcp_leases
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
# if /apps partition is not present then we don't support urlfiltering
|
||||
[ -d "/apps" ] || exit 0
|
||||
|
||||
COUNT=1
|
||||
|
||||
add_urlbundle()
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ IP_RULE=""
|
|||
ACL_FILE=""
|
||||
parentalcontrol_ipv4_forward=""
|
||||
parentalcontrol_ipv6_forward=""
|
||||
default_bundle_dir="/tmp/parentalcontrol/default/"
|
||||
default_bundle_dir="/apps/parentalcontrol/default/"
|
||||
bundle_archive="/etc/parentalcontrol/urlbundles.tar.xz"
|
||||
|
||||
log() {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ LOCKFILE="/tmp/sync_bundles.lock"
|
|||
# if its a remote file, then it would be downloaded and placed in bundle_dir
|
||||
bundle_path="$(uci -q get parentalcontrol.globals.bundle_path)"
|
||||
if [ -z "${bundle_path}" ]; then
|
||||
bundle_path="/tmp/parentalcontrol"
|
||||
bundle_path="/apps/parentalcontrol"
|
||||
fi
|
||||
|
||||
stringstore_dir="${bundle_path}/stringstore"
|
||||
|
|
@ -227,8 +227,8 @@ handle_filter_for_bundles() {
|
|||
local urlfilter
|
||||
|
||||
urlfilter="$(uci -q get parentalcontrol.globals.urlfilter)"
|
||||
if [ "${urlfilter}" -ne "1" ]; then
|
||||
logger -p info "urlbundle not supported"
|
||||
# if urlfilter is not enabled or apps partition is not present, then return
|
||||
if [ "${urlfilter}" -ne "1" ] || [ ! -d "/apps" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue