mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-30 06:55:13 +08:00
🌴 Sync 2026-03-05 23:51:42
This commit is contained in:
1 parent
97c049ed0a
commit
0acff03804
14253 files changed
+3893239
No files matched your search
@@ -0,0 +1,54 @@
|
||||
#
|
||||
# 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
|
||||
PKG_VERSION:=0.0.3
|
||||
PKG_RELEASE:=1
|
||||
PKG_SOURCE:=$(PKG_NAME)-binary-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/linkease/istore-packages/releases/download/prebuilt/
|
||||
PKG_HASH:=skip
|
||||
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
|
||||
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 Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/config
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/kai.$(PKG_ARCH_kai) $(1)/usr/sbin/kai_bin
|
||||
$(INSTALL_BIN) ./files/kai.init $(1)/etc/init.d/kai
|
||||
$(INSTALL_CONF) ./files/kai.config $(1)/etc/config/kai
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
@@ -0,0 +1,3 @@
|
||||
config kai
|
||||
option 'enabled' '0'
|
||||
option 'cwd' '/tmp/kai'
|
||||
Executable
+48
@@ -0,0 +1,48 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=93
|
||||
USE_PROCD=1
|
||||
|
||||
get_config() {
|
||||
config_get_bool enabled $1 enabled 1
|
||||
config_get cwd $1 cwd "/tmp/kai"
|
||||
}
|
||||
|
||||
start_kai_bin(){
|
||||
procd_open_instance kai_bin
|
||||
procd_set_param command /usr/sbin/kai_bin
|
||||
procd_set_param stderr 1
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
mkdir_cwd(){
|
||||
if [ ! -d $1 ]; then
|
||||
mkdir -p $1
|
||||
fi
|
||||
}
|
||||
start_kai_session(){
|
||||
procd_open_instance kai_session
|
||||
procd_set_param env OPENCODE_CWD=$1 OPENCODE_CONFIG=http://127.0.0.1:8197/config/opencode/opencode.json
|
||||
procd_set_param command /usr/sbin/kai_session
|
||||
procd_append_param command serve --port "8196" --hostname "127.0.0.1"
|
||||
procd_set_param stderr 1
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
start_service() {
|
||||
config_load kai
|
||||
config_foreach get_config kai
|
||||
if [ $enabled != 1 ]; then
|
||||
return 1
|
||||
fi
|
||||
logger -t kai "Starting KAI Service"
|
||||
start_kai_bin
|
||||
sleep 1
|
||||
mkdir_cwd $cwd
|
||||
start_kai_session $cwd
|
||||
logger -t kai "Starting KAI Service Completed"
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "kai"
|
||||
}
|
||||
Reference in new issue
Block a user