mirror of
https://github.com/kenzok8/small-package.git
synced 2026-02-04 13:57:45 +08:00
update 2026-01-19 16:38:09
This commit is contained in:
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
LUCI_TITLE:=kai
|
LUCI_TITLE:=kai
|
||||||
PKG_VERSION:=1.0.0
|
PKG_VERSION:=1.0.0
|
||||||
PKG_RELEASE:=0
|
PKG_RELEASE:=0
|
||||||
LUCI_DEPENDS:=+kai
|
LUCI_DEPENDS:=+kai +kai_session
|
||||||
LUCI_MINIFY_CSS:=0
|
LUCI_MINIFY_CSS:=0
|
||||||
LUCI_MINIFY_JS:=0
|
LUCI_MINIFY_JS:=0
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=luci-app-passwall2
|
PKG_NAME:=luci-app-passwall2
|
||||||
PKG_VERSION:=26.1.18
|
PKG_VERSION:=26.1.19
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
PKG_PO_VERSION:=$(PKG_VERSION)
|
PKG_PO_VERSION:=$(PKG_VERSION)
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ UTIL_XRAY=$LUA_UTIL_PATH/util_xray.lua
|
|||||||
UTIL_NAIVE=$LUA_UTIL_PATH/util_naiveproxy.lua
|
UTIL_NAIVE=$LUA_UTIL_PATH/util_naiveproxy.lua
|
||||||
UTIL_HYSTERIA2=$LUA_UTIL_PATH/util_hysteria2.lua
|
UTIL_HYSTERIA2=$LUA_UTIL_PATH/util_hysteria2.lua
|
||||||
UTIL_TUIC=$LUA_UTIL_PATH/util_tuic.lua
|
UTIL_TUIC=$LUA_UTIL_PATH/util_tuic.lua
|
||||||
|
SINGBOX_BIN=$(first_type $(config_t_get global_app sing_box_file) sing-box)
|
||||||
|
XRAY_BIN=$(first_type $(config_t_get global_app xray_file) xray)
|
||||||
|
|
||||||
check_run_environment() {
|
check_run_environment() {
|
||||||
local prefer_nft=$(config_t_get global_forwarding prefer_nft 1)
|
local prefer_nft=$(config_t_get global_forwarding prefer_nft 1)
|
||||||
@@ -74,12 +76,6 @@ run_xray() {
|
|||||||
local loglevel log_file config_file
|
local loglevel log_file config_file
|
||||||
local _extra_param=""
|
local _extra_param=""
|
||||||
eval_set_val $@
|
eval_set_val $@
|
||||||
local type=$(echo $(config_n_get $node type) | tr 'A-Z' 'a-z')
|
|
||||||
if [ "$type" != "xray" ]; then
|
|
||||||
local bin=$(first_type $(config_t_get global_app xray_file) xray)
|
|
||||||
[ -n "$bin" ] && type="xray"
|
|
||||||
fi
|
|
||||||
[ -z "$type" ] && return 1
|
|
||||||
[ -n "$log_file" ] || local log_file="/dev/null"
|
[ -n "$log_file" ] || local log_file="/dev/null"
|
||||||
[ -z "$loglevel" ] && local loglevel=$(config_t_get global loglevel "warning")
|
[ -z "$loglevel" ] && local loglevel=$(config_t_get global loglevel "warning")
|
||||||
[ -n "$flag" ] && pgrep -af "$TMP_BIN_PATH" | awk -v P1="${flag}" 'BEGIN{IGNORECASE=1}$0~P1{print $1}' | xargs kill -9 >/dev/null 2>&1
|
[ -n "$flag" ] && pgrep -af "$TMP_BIN_PATH" | awk -v P1="${flag}" 'BEGIN{IGNORECASE=1}$0~P1{print $1}' | xargs kill -9 >/dev/null 2>&1
|
||||||
@@ -167,7 +163,7 @@ run_xray() {
|
|||||||
DNS_REMOTE_ARGS="${DNS_REMOTE_ARGS} -dns_out_tag remote -dns_listen_port ${dns_remote_listen_port} -remote_dns_outbound_socks_address 127.0.0.1 -remote_dns_outbound_socks_port ${socks_port}"
|
DNS_REMOTE_ARGS="${DNS_REMOTE_ARGS} -dns_out_tag remote -dns_listen_port ${dns_remote_listen_port} -remote_dns_outbound_socks_address 127.0.0.1 -remote_dns_outbound_socks_port ${socks_port}"
|
||||||
|
|
||||||
lua $UTIL_XRAY gen_dns_config ${DNS_REMOTE_ARGS} > $V2RAY_DNS_REMOTE_CONFIG
|
lua $UTIL_XRAY gen_dns_config ${DNS_REMOTE_ARGS} > $V2RAY_DNS_REMOTE_CONFIG
|
||||||
ln_run "$(first_type $(config_t_get global_app ${type}_file) ${type})" ${type} $V2RAY_DNS_REMOTE_LOG run -c "$V2RAY_DNS_REMOTE_CONFIG"
|
ln_run "$XRAY_BIN" "xray" $V2RAY_DNS_REMOTE_LOG run -c "$V2RAY_DNS_REMOTE_CONFIG"
|
||||||
_extra_param="${_extra_param} -remote_dns_udp_port ${dns_remote_listen_port} -remote_dns_udp_server 127.0.0.1 -remote_dns_query_strategy ${remote_dns_query_strategy}"
|
_extra_param="${_extra_param} -remote_dns_udp_port ${dns_remote_listen_port} -remote_dns_udp_server 127.0.0.1 -remote_dns_query_strategy ${remote_dns_query_strategy}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -178,7 +174,13 @@ run_xray() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
lua $UTIL_XRAY gen_config -node $node -loglevel $loglevel ${_extra_param} > $config_file
|
lua $UTIL_XRAY gen_config -node $node -loglevel $loglevel ${_extra_param} > $config_file
|
||||||
ln_run "$(first_type $(config_t_get global_app ${type}_file) ${type})" ${type} $log_file run -c "$config_file"
|
|
||||||
|
$XRAY_BIN run -test -c "$config_file" > $log_file; local status=$?
|
||||||
|
if [ "${status}" == 0 ]; then
|
||||||
|
ln_run "$XRAY_BIN" xray $log_file run -c "$config_file"
|
||||||
|
else
|
||||||
|
return ${status}
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
run_singbox() {
|
run_singbox() {
|
||||||
@@ -199,8 +201,7 @@ run_singbox() {
|
|||||||
[ -z "$loglevel" ] && local loglevel=$(config_t_get global loglevel "warn")
|
[ -z "$loglevel" ] && local loglevel=$(config_t_get global loglevel "warn")
|
||||||
[ "$loglevel" = "warning" ] && loglevel="warn"
|
[ "$loglevel" = "warning" ] && loglevel="warn"
|
||||||
_extra_param="${_extra_param} -loglevel $loglevel"
|
_extra_param="${_extra_param} -loglevel $loglevel"
|
||||||
|
_extra_param="${_extra_param} -tags $($SINGBOX_BIN version | grep 'Tags:' | awk '{print $2}')"
|
||||||
_extra_param="${_extra_param} -tags $($(first_type $(config_t_get global_app sing_box_file) sing-box) version | grep 'Tags:' | awk '{print $2}')"
|
|
||||||
|
|
||||||
[ -n "$flag" ] && pgrep -af "$TMP_BIN_PATH" | awk -v P1="${flag}" 'BEGIN{IGNORECASE=1}$0~P1{print $1}' | xargs kill -9 >/dev/null 2>&1
|
[ -n "$flag" ] && pgrep -af "$TMP_BIN_PATH" | awk -v P1="${flag}" 'BEGIN{IGNORECASE=1}$0~P1{print $1}' | xargs kill -9 >/dev/null 2>&1
|
||||||
[ -n "$flag" ] && _extra_param="${_extra_param} -flag $flag"
|
[ -n "$flag" ] && _extra_param="${_extra_param} -flag $flag"
|
||||||
@@ -284,7 +285,13 @@ run_singbox() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
lua $UTIL_SINGBOX gen_config -node $node ${_extra_param} > $config_file
|
lua $UTIL_SINGBOX gen_config -node $node ${_extra_param} > $config_file
|
||||||
ln_run "$(first_type $(config_t_get global_app sing_box_file) sing-box)" "sing-box" "${log_file}" run -c "$config_file"
|
|
||||||
|
$SINGBOX_BIN check -c "$config_file" > $log_file 2>&1; local status=$?
|
||||||
|
if [ "${status}" == 0 ]; then
|
||||||
|
ln_run "$SINGBOX_BIN" "sing-box" "${log_file}" run -c "$config_file"
|
||||||
|
else
|
||||||
|
return ${status}
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
run_socks() {
|
run_socks() {
|
||||||
@@ -347,7 +354,7 @@ run_socks() {
|
|||||||
}
|
}
|
||||||
[ -n "$no_run" ] && _extra_param="${_extra_param} -no_run 1"
|
[ -n "$no_run" ] && _extra_param="${_extra_param} -no_run 1"
|
||||||
lua $UTIL_SINGBOX gen_config -flag SOCKS_$flag -node $node -local_socks_address $bind -local_socks_port $socks_port ${_extra_param} > $config_file
|
lua $UTIL_SINGBOX gen_config -flag SOCKS_$flag -node $node -local_socks_address $bind -local_socks_port $socks_port ${_extra_param} > $config_file
|
||||||
[ -n "$no_run" ] || ln_run "$(first_type $(config_t_get global_app sing_box_file) sing-box)" "sing-box" /dev/null run -c "$config_file"
|
[ -n "$no_run" ] || ln_run "$SINGBOX_BIN" "sing-box" /dev/null run -c "$config_file"
|
||||||
;;
|
;;
|
||||||
xray)
|
xray)
|
||||||
[ "$http_port" != "0" ] && {
|
[ "$http_port" != "0" ] && {
|
||||||
@@ -358,7 +365,7 @@ run_socks() {
|
|||||||
[ -n "$relay_port" ] && _extra_param="${_extra_param} -server_host $server_host -server_port $server_port"
|
[ -n "$relay_port" ] && _extra_param="${_extra_param} -server_host $server_host -server_port $server_port"
|
||||||
[ -n "$no_run" ] && _extra_param="${_extra_param} -no_run 1"
|
[ -n "$no_run" ] && _extra_param="${_extra_param} -no_run 1"
|
||||||
lua $UTIL_XRAY gen_config -flag SOCKS_$flag -node $node -local_socks_address $bind -local_socks_port $socks_port ${_extra_param} > $config_file
|
lua $UTIL_XRAY gen_config -flag SOCKS_$flag -node $node -local_socks_address $bind -local_socks_port $socks_port ${_extra_param} > $config_file
|
||||||
[ -n "$no_run" ] || ln_run "$(first_type $(config_t_get global_app xray_file) xray)" "xray" $log_file run -c "$config_file"
|
[ -n "$no_run" ] || ln_run "$XRAY_BIN" "xray" $log_file run -c "$config_file"
|
||||||
;;
|
;;
|
||||||
naiveproxy)
|
naiveproxy)
|
||||||
lua $UTIL_NAIVE gen_config -node $node -run_type socks -local_addr $bind -local_port $socks_port -server_host $server_host -server_port $server_port > $config_file
|
lua $UTIL_NAIVE gen_config -node $node -run_type socks -local_addr $bind -local_port $socks_port -server_host $server_host -server_port $server_port > $config_file
|
||||||
@@ -407,13 +414,13 @@ run_socks() {
|
|||||||
|
|
||||||
# http to socks
|
# http to socks
|
||||||
[ -z "$http_flag" ] && [ "$http_port" != "0" ] && [ -n "$http_config_file" ] && [ "$type" != "sing-box" ] && [ "$type" != "xray" ] && [ "$type" != "socks" ] && {
|
[ -z "$http_flag" ] && [ "$http_port" != "0" ] && [ -n "$http_config_file" ] && [ "$type" != "sing-box" ] && [ "$type" != "xray" ] && [ "$type" != "socks" ] && {
|
||||||
local bin=$(first_type $(config_t_get global_app sing_box_file) sing-box)
|
local bin=$SINGBOX_BIN
|
||||||
if [ -n "$bin" ]; then
|
if [ -n "$bin" ]; then
|
||||||
type="sing-box"
|
type="sing-box"
|
||||||
lua $UTIL_SINGBOX gen_proto_config -local_http_port $http_port -server_proto socks -server_address "127.0.0.1" -server_port $socks_port -server_username $_username -server_password $_password > $http_config_file
|
lua $UTIL_SINGBOX gen_proto_config -local_http_port $http_port -server_proto socks -server_address "127.0.0.1" -server_port $socks_port -server_username $_username -server_password $_password > $http_config_file
|
||||||
[ -n "$no_run" ] || ln_run "$bin" ${type} /dev/null run -c "$http_config_file"
|
[ -n "$no_run" ] || ln_run "$bin" ${type} /dev/null run -c "$http_config_file"
|
||||||
else
|
else
|
||||||
bin=$(first_type $(config_t_get global_app xray_file) xray)
|
bin=$XRAY_BIN
|
||||||
[ -n "$bin" ] && type="xray"
|
[ -n "$bin" ] && type="xray"
|
||||||
[ -z "$type" ] && return 1
|
[ -z "$type" ] && return 1
|
||||||
lua $UTIL_XRAY gen_proto_config -local_http_port $http_port -server_proto socks -server_address "127.0.0.1" -server_port $socks_port -server_username $_username -server_password $_password > $http_config_file
|
lua $UTIL_XRAY gen_proto_config -local_http_port $http_port -server_proto socks -server_address "127.0.0.1" -server_port $socks_port -server_username $_username -server_password $_password > $http_config_file
|
||||||
@@ -533,12 +540,9 @@ run_global() {
|
|||||||
run_func="run_singbox"
|
run_func="run_singbox"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
${run_func} ${V2RAY_ARGS}
|
${run_func} ${V2RAY_ARGS}; local status=$?
|
||||||
|
|
||||||
sleep 1s
|
if [ "$status" == 0 ]; then
|
||||||
|
|
||||||
netstat -tuln | grep "LISTEN" | grep "${REDIR_PORT}" >/dev/null; REDIR_PORT_STATUS=$?
|
|
||||||
if [ "$REDIR_PORT_STATUS" == 0 ]; then
|
|
||||||
log 0 ${dns_msg}
|
log 0 ${dns_msg}
|
||||||
else
|
else
|
||||||
log_i18n 0 "[%s] process %s error, skip!" $(i18n "Global") "${V2RAY_CONFIG}"
|
log_i18n 0 "[%s] process %s error, skip!" $(i18n "Global") "${V2RAY_CONFIG}"
|
||||||
@@ -937,9 +941,8 @@ acl_app() {
|
|||||||
remote_dns_protocol=${remote_dns_protocol} remote_dns_tcp_server=${remote_dns} remote_dns_udp_server=${remote_dns} remote_dns_doh="${remote_dns}" \
|
remote_dns_protocol=${remote_dns_protocol} remote_dns_tcp_server=${remote_dns} remote_dns_udp_server=${remote_dns} remote_dns_doh="${remote_dns}" \
|
||||||
remote_dns_client_ip=${remote_dns_client_ip} remote_dns_detour=${remote_dns_detour} remote_fakedns=${remote_fakedns} remote_dns_query_strategy=${remote_dns_query_strategy} \
|
remote_dns_client_ip=${remote_dns_client_ip} remote_dns_detour=${remote_dns_detour} remote_fakedns=${remote_fakedns} remote_dns_query_strategy=${remote_dns_query_strategy} \
|
||||||
write_ipset_direct=${write_ipset_direct} config_file=${config_file}
|
write_ipset_direct=${write_ipset_direct} config_file=${config_file}
|
||||||
sleep 1s
|
local status=$?
|
||||||
netstat -tuln | grep "LISTEN" | grep "${redir_port}" >/dev/null; redir_port_status=$?
|
if [ "$status" != 0 ]; then
|
||||||
if [ "$redir_port_status" != 0 ]; then
|
|
||||||
log_i18n 2 "[%s] process %s error, skip!" "${remarks}" "${config_file}"
|
log_i18n 2 "[%s] process %s error, skip!" "${remarks}" "${config_file}"
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
@@ -1107,9 +1110,6 @@ get_config() {
|
|||||||
fi
|
fi
|
||||||
set_cache_var GLOBAL_DNSMASQ_CONF ${DNSMASQ_CONF_DIR}/dnsmasq-${CONFIG}.conf
|
set_cache_var GLOBAL_DNSMASQ_CONF ${DNSMASQ_CONF_DIR}/dnsmasq-${CONFIG}.conf
|
||||||
set_cache_var GLOBAL_DNSMASQ_CONF_PATH ${GLOBAL_ACL_PATH}/dnsmasq.d
|
set_cache_var GLOBAL_DNSMASQ_CONF_PATH ${GLOBAL_ACL_PATH}/dnsmasq.d
|
||||||
|
|
||||||
XRAY_BIN=$(first_type $(config_t_get global_app xray_file) xray)
|
|
||||||
SINGBOX_BIN=$(first_type $(config_t_get global_app sing_box_file) sing-box)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
arg1=$1
|
arg1=$1
|
||||||
|
|||||||
@@ -474,10 +474,10 @@ table inet nikki {
|
|||||||
meta nfproto @proxy_nfproto jump router_redirect
|
meta nfproto @proxy_nfproto jump router_redirect
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if (fake_ip_ping_hijack): %}
|
{% if (fake_ip_ping_hijack): %}
|
||||||
{% if (fake_ip_range ): %}
|
{% if (fake_ip_range): %}
|
||||||
icmp type echo-request ip daddr {{ fake_ip_range }} counter redirect
|
icmp type echo-request ip daddr {{ fake_ip_range }} counter redirect
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if (fake_ip6_range ): %}
|
{% if (fake_ip6_range): %}
|
||||||
icmpv6 type echo-request ip6 daddr {{ fake_ip6_range }} counter redirect
|
icmpv6 type echo-request ip6 daddr {{ fake_ip6_range }} counter redirect
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -555,7 +555,7 @@ table inet nikki {
|
|||||||
{% if (fake_ip_range): %}
|
{% if (fake_ip_range): %}
|
||||||
icmp type echo-request ip daddr {{ fake_ip_range }} counter redirect
|
icmp type echo-request ip daddr {{ fake_ip_range }} counter redirect
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if (fake_ip6_range ): %}
|
{% if (fake_ip6_range): %}
|
||||||
icmpv6 type echo-request ip6 daddr {{ fake_ip6_range }} counter redirect
|
icmpv6 type echo-request ip6 daddr {{ fake_ip6_range }} counter redirect
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ PKG_VERSION:=0.0.1
|
|||||||
PKG_RELEASE:=0
|
PKG_RELEASE:=0
|
||||||
PKG_SOURCE:=$(PKG_NAME)-binary-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-binary-$(PKG_VERSION).tar.gz
|
||||||
PKG_SOURCE_URL:=https://github.com/Carseason/openwrt-packages/releases/download/prebuilt/
|
PKG_SOURCE_URL:=https://github.com/Carseason/openwrt-packages/releases/download/prebuilt/
|
||||||
PKG_HASH:=ac0f198049f3a9c0483c88d5bd48531b3ca0d85a7320291e94d7054afd4ea412
|
PKG_HASH:=51b20a41da99dc1b6ab616e203cba824bf644699813316f858055fa6e1343860
|
||||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-binary-$(PKG_VERSION)
|
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-binary-$(PKG_VERSION)
|
||||||
|
|
||||||
PKG_BUILD_PARALLEL:=1
|
PKG_BUILD_PARALLEL:=1
|
||||||
@@ -56,8 +56,7 @@ endef
|
|||||||
|
|
||||||
define Package/$(PKG_NAME)/install
|
define Package/$(PKG_NAME)/install
|
||||||
$(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/uci-defaults $(1)/etc/config
|
$(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/uci-defaults $(1)/etc/config
|
||||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/kai_bin.$(PKG_ARCH_kai) $(1)/usr/sbin/kai_bin
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/kai.$(PKG_ARCH_kai) $(1)/usr/sbin/kai_bin
|
||||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/kai_session.$(PKG_ARCH_kai) $(1)/usr/sbin/kai_session
|
|
||||||
$(INSTALL_BIN) ./files/kai.init $(1)/etc/init.d/kai
|
$(INSTALL_BIN) ./files/kai.init $(1)/etc/init.d/kai
|
||||||
$(INSTALL_BIN) ./files/kai.uci-default $(1)/etc/uci-defaults/09-kai
|
$(INSTALL_BIN) ./files/kai.uci-default $(1)/etc/uci-defaults/09-kai
|
||||||
$(INSTALL_CONF) ./files/kai.config $(1)/etc/config/kai
|
$(INSTALL_CONF) ./files/kai.config $(1)/etc/config/kai
|
||||||
|
|||||||
@@ -7,14 +7,6 @@ get_config() {
|
|||||||
config_get_bool enabled $1 enabled 1
|
config_get_bool enabled $1 enabled 1
|
||||||
}
|
}
|
||||||
|
|
||||||
start_kai_session(){
|
|
||||||
procd_open_instance
|
|
||||||
procd_set_param env OPENCODE_CONFIG http://127.0.0.1:8197/config/opencode/opencode.json
|
|
||||||
procd_set_param command cd /tmp && /usr/sbin/kai_session --port=8196 --hostname=127.0.0.1
|
|
||||||
procd_set_param stderr 1
|
|
||||||
procd_set_param respawn
|
|
||||||
procd_close_instance
|
|
||||||
}
|
|
||||||
start_kai_bin(){
|
start_kai_bin(){
|
||||||
procd_open_instance
|
procd_open_instance
|
||||||
procd_set_param command /usr/sbin/kai_bin
|
procd_set_param command /usr/sbin/kai_bin
|
||||||
@@ -22,20 +14,24 @@ start_kai_bin(){
|
|||||||
procd_set_param respawn
|
procd_set_param respawn
|
||||||
procd_close_instance
|
procd_close_instance
|
||||||
}
|
}
|
||||||
|
start_kai_session(){
|
||||||
|
procd_open_instance
|
||||||
|
procd_set_param env OPENCODE_CONFIG="http://127.0.0.1:8197/config/opencode/opencode.json"
|
||||||
|
procd_set_param command cd /tmp && /usr/sbin/kai_session
|
||||||
|
procd_append_param command --port "8196"
|
||||||
|
procd_append_param command --hostname "127.0.0.1"
|
||||||
|
procd_set_param stderr 1
|
||||||
|
procd_set_param respawn
|
||||||
|
procd_close_instance
|
||||||
|
}
|
||||||
start_service() {
|
start_service() {
|
||||||
config_load kai
|
config_load kai
|
||||||
config_foreach get_config kai
|
config_foreach get_config kai
|
||||||
[ $enabled != 1 ] && return 1
|
[ $enabled != 1 ] && return 1
|
||||||
start_kai_session
|
|
||||||
start_kai_bin
|
start_kai_bin
|
||||||
}
|
start_kai_session
|
||||||
|
|
||||||
|
|
||||||
kai_prepare() {
|
|
||||||
killall kai_bin 2>/dev/null
|
|
||||||
killall kai_session 2>/dev/null
|
|
||||||
}
|
}
|
||||||
stop_service() {
|
stop_service() {
|
||||||
kai_prepare
|
killall kai_bin 2>/dev/null
|
||||||
|
killall kai_session 2>/dev/null
|
||||||
}
|
}
|
||||||
62
services/kai_session/Makefile
Normal file
62
services/kai_session/Makefile
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2015-2016 OpenWrt.org
|
||||||
|
# Copyright (C) 2020 jjm2473@gmail.com
|
||||||
|
#
|
||||||
|
# This is free software, licensed under the GNU General Public License v3.
|
||||||
|
#
|
||||||
|
|
||||||
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
|
PKG_ARCH_kai:=$(ARCH)
|
||||||
|
|
||||||
|
PKG_NAME:=kai_session
|
||||||
|
PKG_VERSION:=0.0.1
|
||||||
|
PKG_RELEASE:=0
|
||||||
|
PKG_SOURCE:=$(PKG_NAME)-binary-$(PKG_VERSION).tar.gz
|
||||||
|
PKG_SOURCE_URL:=https://github.com/Carseason/openwrt-packages/releases/download/prebuilt/
|
||||||
|
PKG_HASH:=efef8ae3360a682c215b44a908a71480ca064eadc0380f28f2f400edc84807fe
|
||||||
|
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-binary-$(PKG_VERSION)
|
||||||
|
|
||||||
|
PKG_BUILD_PARALLEL:=1
|
||||||
|
PKG_USE_MIPS16:=0
|
||||||
|
|
||||||
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
|
define Package/$(PKG_NAME)
|
||||||
|
SECTION:=net
|
||||||
|
CATEGORY:=System
|
||||||
|
SUBMENU:=
|
||||||
|
TITLE:=KAI_SESSION
|
||||||
|
URL:=https://github.com/Carseason/openwrt-packages
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/$(PKG_NAME)/description
|
||||||
|
KAI is a dashboard & user guide
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/$(PKG_NAME)/conffiles
|
||||||
|
/etc/config/kai
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/$(PKG_NAME)/postinst
|
||||||
|
#!/bin/sh
|
||||||
|
if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||||
|
if [ -f /etc/uci-defaults/09-kai ]; then
|
||||||
|
chmod 755 /etc/uci-defaults/09-kai
|
||||||
|
/etc/uci-defaults/09-kai && rm -f /etc/uci-defaults/09-kai
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Build/Configure
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Build/Compile
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/$(PKG_NAME)/install
|
||||||
|
$(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/uci-defaults $(1)/etc/config
|
||||||
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/kai_session.$(PKG_ARCH_kai) $(1)/usr/sbin/kai_session
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||||
@@ -21,13 +21,13 @@ define Download/geoip
|
|||||||
HASH:=ed2de9add79623e2e5dbc5930ee39cc7037a7c6e0ecd58ba528b6f73d61457b5
|
HASH:=ed2de9add79623e2e5dbc5930ee39cc7037a7c6e0ecd58ba528b6f73d61457b5
|
||||||
endef
|
endef
|
||||||
|
|
||||||
GEOSITE_VER:=20260117053629
|
GEOSITE_VER:=20260119054648
|
||||||
GEOSITE_FILE:=dlc.dat.$(GEOSITE_VER)
|
GEOSITE_FILE:=dlc.dat.$(GEOSITE_VER)
|
||||||
define Download/geosite
|
define Download/geosite
|
||||||
URL:=https://github.com/v2fly/domain-list-community/releases/download/$(GEOSITE_VER)/
|
URL:=https://github.com/v2fly/domain-list-community/releases/download/$(GEOSITE_VER)/
|
||||||
URL_FILE:=dlc.dat
|
URL_FILE:=dlc.dat
|
||||||
FILE:=$(GEOSITE_FILE)
|
FILE:=$(GEOSITE_FILE)
|
||||||
HASH:=b8ae0a67f1abff87fcdef3ae4439984075a7ba6af667fa6d8b5bfe316ccf65c5
|
HASH:=0aa20151e866359fd6bc4b94542c208feab71ff8a9552079d790e28b39883492
|
||||||
endef
|
endef
|
||||||
|
|
||||||
GEOSITE_IRAN_VER:=202601190048
|
GEOSITE_IRAN_VER:=202601190048
|
||||||
|
|||||||
Reference in New Issue
Block a user