添加 bfstart 返回值判断

This commit is contained in:
RikudouPatrickstar
2022-01-21 17:14:31 +08:00
committed by GitHub
parent 4195500d5f
commit c28b2fafdc

View File

@@ -14,6 +14,7 @@ BINDIR=$(cat $DIR/mark | grep bindir | awk -F "=" '{print $2}')
start_service() {
#检测必须文件
$DIR/start.sh bfstart
if [ "$?" = "0" ];then
#使用procd创建clash后台进程
procd_open_instance
procd_set_param respawn
@@ -23,18 +24,21 @@ start_service() {
procd_close_instance
#其他设置
$DIR/start.sh afstart
fi
}
start() {
if [ -z "$(pidof procd)" ];then
#检测必须文件
$DIR/start.sh bfstart
if [ "$?" = "0" ];then
#创建后台进程
service_start $BINDIR/clash -d $BINDIR
#其他设置
$DIR/start.sh afstart
#设置守护进程
$DIR/start.sh deamon
fi
else
start_service
fi