appfilter.init revision fd21eb38
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 #lang=`uci get luci.main.lang` 23 rm $FEATURE_FILE 24 update=`uci get appfilter.feature.update` 25 if [ x"1" == x"$update" ];then 26 ln -s /etc/appfilter/feature.cfg $FEATURE_FILE 27 else 28 uci get luci.languages.zh_cn >/dev/null 29 if [ $? -eq 0 ];then 30 test -f $FEATURE_FILE && rm $FEATURE_FILE 31 ln -s /etc/appfilter/feature_cn.cfg $FEATURE_FILE 32 else 33 ln -s /etc/appfilter/feature_en.cfg $FEATURE_FILE 34 fi 35 fi 36 gen_class.sh /tmp/feature.cfg 37 insmod oaf 38 /usr/bin/oaf_rule reload 39 procd_open_instance 40 procd_set_param respawn 60 5 5 41 procd_set_param stderr 1 42 procd_set_param command "$OAFD_BIN" 43 procd_close_instance 44} 45