docs: refactor
This commit is contained in:
28
docs/confs/wrt_bin
Normal file
28
docs/confs/wrt_bin
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
/etc/init.d/saveanybot start
|
||||
;;
|
||||
stop)
|
||||
/etc/init.d/saveanybot stop
|
||||
;;
|
||||
restart)
|
||||
/etc/init.d/saveanybot restart
|
||||
;;
|
||||
status)
|
||||
/etc/init.d/saveanybot status
|
||||
;;
|
||||
enable)
|
||||
/etc/init.d/saveanybot enable
|
||||
echo "Enable SaveAnyBot auto-start."
|
||||
;;
|
||||
disable)
|
||||
/etc/init.d/saveanybot disable
|
||||
echo "Disable SaveAnyBot auto-start."
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|status|enable|disable}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
34
docs/confs/wrt_init
Normal file
34
docs/confs/wrt_init
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
# This is the OpenWRT init.d script for SaveAnyBot
|
||||
|
||||
START=99 # 设置启动顺序,数字越大越后启动
|
||||
STOP=10 # 设置停止顺序,数字越小越先停止
|
||||
|
||||
# 脚本描述
|
||||
description="SaveAnyBot"
|
||||
|
||||
# 设置工作目录和执行文件路径
|
||||
WORKING_DIR="/mnt/mmc1-1/SaveAnyBot"
|
||||
EXEC_PATH="$WORKING_DIR/saveany-bot"
|
||||
|
||||
# 启动函数
|
||||
start() {
|
||||
echo "Starting SaveAnyBot..."
|
||||
# 切换到工作目录并执行程序
|
||||
cd $WORKING_DIR
|
||||
$EXEC_PATH &
|
||||
}
|
||||
|
||||
# 停止函数
|
||||
stop() {
|
||||
echo "Stopping SaveAnyBot..."
|
||||
# 查找并杀死进程
|
||||
killall saveany-bot
|
||||
}
|
||||
|
||||
# 重启函数
|
||||
reload() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
Reference in New Issue
Block a user