open-app-filter: auto unload kmod

This commit is contained in:
jjm2473 2022-04-15 14:08:49 +08:00 committed by sbwml
parent 70b6d77daf
commit 6b80027765
2 changed files with 8 additions and 2 deletions

View File

@ -3,7 +3,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=appfilter
PKG_VERSION:=5.0.2
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk

View File

@ -12,13 +12,15 @@ service_triggers()
procd_add_reload_trigger "appfilter"
}
stop_service(){
service_stopped(){
killall -9 oafd
rmmod oaf
}
start_service(){
local update
[ "x`uci get appfilter.global.enable`" = "x1" ] || return 0
rm $FEATURE_FILE
update=`uci get appfilter.feature.update`
if [ x"1" == x"$update" ];then
@ -41,3 +43,7 @@ start_service(){
procd_set_param command "$OAFD_BIN"
procd_close_instance
}
service_started() {
[ "x`uci get appfilter.global.enable`" != "x1" ] && rmmod oaf
}