op-packages/luci-app-neko/root/etc/init.d/neko
github-actions[bot] 32600acc60 🌴 Sync 2026-03-05 23:51:42
2026-03-05 23:51:42 +08:00

55 lines
730 B
Bash
Executable File

#!/bin/sh /etc/rc.common
# (C) 2024 nosignal
START=99
BIN="/etc/neko/core/neko"
SINGBOX="/etc/neko/core/singbox"
start() {
core_mode=$(uci -q get neko.cfg.core_mode)
sleep 1
if [ "$core_mode" = "singbox" ]; then
$SINGBOX -s
else
$BIN -s
fi
if [ "$(uci -q get neko.cfg.php_server)" = "1" ]; then
$BIN -p
fi
}
restart() {
core_mode=$(uci -q get neko.cfg.core_mode)
if [ "$core_mode" = "singbox" ]; then
$SINGBOX -r
else
$BIN -r
fi
}
stop() {
core_mode=$(uci -q get neko.cfg.core_mode)
if [ "$(uci -q get neko.cfg.php_server)" = "1" ]; then
$BIN -c
else
if [ "$core_mode" = "singbox" ]; then
$SINGBOX -k
else
$BIN -k
fi
fi
}
stop_service() {
stop
}
reload_service() {
restart
}