1#!/bin/sh /etc/rc.common 2. /usr/share/libubox/jshn.sh 3. /lib/functions.sh 4 5START=96 6USE_PROCD=1 7OAFD_BIN="/usr/bin/oafd" 8FEATURE_FILE="/tmp/feature.cfg" 9CLASS_FILE="/tmp/app_class.txt" 10service_triggers() 11{ 12 procd_add_reload_trigger "appfilter" 13} 14 15stop_service(){ 16 killall -9 oafd 17 rmmod oaf 18} 19 20start_service(){ 21 local update 22 rm $FEATURE_FILE 23 update=`uci get appfilter.feature.update` 24 if [ x"1" == x"$update" ];then 25 ln -s /etc/appfilter/feature.cfg $FEATURE_FILE 26 else 27 uci get luci.languages.zh_cn >/dev/null 2>&1 28 if [ $? -eq 0 ];then 29 test -f $FEATURE_FILE && rm $FEATURE_FILE 30 ln -s /etc/appfilter/feature_cn.cfg $FEATURE_FILE 31 else 32 ln -s /etc/appfilter/feature_en.cfg $FEATURE_FILE 33 fi 34 fi 35 gen_class.sh /tmp/feature.cfg 36 insmod oaf 37 /usr/bin/oaf_rule reload 38 procd_open_instance 39 procd_set_param respawn 60 5 5 40 procd_set_param stderr 1 41 procd_set_param command "$OAFD_BIN" 42 procd_close_instance 43} 44