mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
parental-control: Align with bbfdm
This commit is contained in:
parent
e0bf63926a
commit
2c3a493457
6 changed files with 25 additions and 7 deletions
|
|
@ -1,8 +1,8 @@
|
|||
if PACKAGE_urlfilter
|
||||
if PACKAGE_parental-control
|
||||
|
||||
menu "Configuration"
|
||||
|
||||
config URLFILTER_INCLUDE_BUNDLES
|
||||
config PARENTAL_CONTROL_INCLUDE_URLFILTER_BUNDLES
|
||||
bool "Include default bundle files"
|
||||
default n
|
||||
help
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=parental-control
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_VERSION:=1.0.1
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
|
|
@ -20,6 +20,7 @@ PKG_LICENSE:=GPL-2.0-only
|
|||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(TOPDIR)/feeds/iopsys/bbfdm/bbfdm.mk
|
||||
|
||||
define Package/parental-control
|
||||
SECTION:=utils
|
||||
|
|
@ -70,8 +71,9 @@ define Package/parental-control/install
|
|||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_DATA) ./files/etc/uci-defaults/95-firewall_parentalcontrol.ucidefaults $(1)/etc/uci-defaults/
|
||||
$(INSTALL_DATA) ./files/etc/uci-defaults/95-migrate_urlfilter.ucidefaults $(1)/etc/uci-defaults/
|
||||
$(BBFDM_REGISTER_SERVICES) ./bbfdm_service.json $(1) parentalcontrol
|
||||
|
||||
ifeq ($(CONFIG_URLFILTER_INCLUDE_BUNDLES),y)
|
||||
ifeq ($(CONFIG_PARENTAL_CONTROL_INCLUDE_URLFILTER_BUNDLES),y)
|
||||
$(INSTALL_DIR) $(1)/etc/parental-control
|
||||
$(INSTALL_DATA) ./files/etc/parental-control/urlbundles.tar.xz $(1)/etc/parental-control/
|
||||
endif
|
||||
|
|
|
|||
16
parental-control/bbfdm_service.json
Normal file
16
parental-control/bbfdm_service.json
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"daemon": {
|
||||
"enable": "1",
|
||||
"service_name": "parentalcontrol",
|
||||
"unified_daemon": true,
|
||||
"services": [
|
||||
{
|
||||
"parent_dm": "Device.",
|
||||
"object": "{BBF_VENDOR_PREFIX}ParentalControl"
|
||||
}
|
||||
],
|
||||
"config": {
|
||||
"loglevel": "3"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -47,7 +47,7 @@ start_service() {
|
|||
# add firewall rules
|
||||
configure_fw_rules
|
||||
|
||||
procd_open_instance urlfilter_dm
|
||||
procd_open_instance parentalcontrol_dm
|
||||
procd_set_param command ${PROG}
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
|
|
@ -60,7 +60,7 @@ stop_service() {
|
|||
}
|
||||
|
||||
reload_service() {
|
||||
ret=$(ubus call service list '{"name":"urlfilter"}' | jsonfilter -qe '@.urlfilter.instances.urlfilter_dm.running')
|
||||
ret=$(ubus call service list '{"name":"parentalcontrol"}' | jsonfilter -qe '@.parentalcontrol.instances.parentalcontrol_dm.running')
|
||||
if [ "$ret" != "true" ]; then
|
||||
stop
|
||||
start
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ ACL_FILE=""
|
|||
parentalcontrol_ipv4_forward=""
|
||||
parentalcontrol_ipv6_forward=""
|
||||
default_bundle_dir="/tmp/urlfilter/default/"
|
||||
bundle_archive="/etc/urlfilter/urlbundles.tar.xz"
|
||||
bundle_archive="/etc/parental-control/urlbundles.tar.xz"
|
||||
|
||||
process_default_bundles() {
|
||||
if [ -s "$bundle_archive" ]; then
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue