v1.0.0beta8fix2
~修复手动更新订阅功能出错的bug ~调整本机代理功能设置 ~修复GoogleHome无法使用的问题 ~调整启动脚本,适配部分采用openwrt12等旧版本的设备
This commit is contained in:
@@ -1,14 +1,15 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Example script
|
||||
# Copyright (C) 2007 OpenWrt.org
|
||||
|
||||
USE_PROCD=1
|
||||
START=92
|
||||
|
||||
SERVICE_DAEMONIZE=1
|
||||
SERVICE_WRITE_PID=1
|
||||
USE_PROCD=1
|
||||
|
||||
|
||||
start_service() {
|
||||
#开机加载环境变量保证找到文件路径
|
||||
source /etc/profile > /dev/null 2>&1
|
||||
#创建clash后台进程
|
||||
clashdir=$(cat /etc/profile|grep clashdir|awk -F "\"" '{print $2}')
|
||||
#使用procd创建clash后台进程
|
||||
procd_open_instance
|
||||
procd_set_param respawn
|
||||
procd_set_param stderr 1
|
||||
@@ -16,5 +17,18 @@ start_service() {
|
||||
procd_set_param command $clashdir/clash -d $clashdir
|
||||
procd_close_instance
|
||||
#其他设置
|
||||
sh $clashdir/start.sh afstart
|
||||
$clashdir/start.sh afstart
|
||||
}
|
||||
|
||||
start() {
|
||||
if [ -z "$(pidof procd)" ];then
|
||||
clashdir=$(cat /etc/profile|grep clashdir|awk -F "\"" '{print $2}')
|
||||
#创建后台进程
|
||||
service_start $clashdir/clash -d $clashdir
|
||||
#$clashdir/start.sh deamon
|
||||
#其他设置
|
||||
$clashdir/start.sh afstart
|
||||
else
|
||||
start_service
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user