Skip to content

Commit

Permalink
1.修复了保活时改掉list文件的问题
Browse files Browse the repository at this point in the history
2.优化了显示singbox链接信息的逻辑
  • Loading branch information
frankiejun committed Sep 8, 2024
1 parent a314cc3 commit cd8ed1e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
16 changes: 12 additions & 4 deletions singbox/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ else
type=$1
fi

keep=$2

run() {
if ps aux | grep cloudflared | grep -v "grep" >/dev/null; then
return
Expand Down Expand Up @@ -70,15 +72,21 @@ EOF
cat list
}

if [ "$keep" = "list" ]; then
export_list
exit 0
fi

if [[ "$type" == "1" || "$type" == "3" ]]; then
run
fi
if [[ "$type" == "1" || "$type" == "2" || "$type" == "3" ]]; then
chmod +x ./serv00sb
if ps aux | grep serv00sb | grep -v "grep" >/dev/null; then
exit 0
if ! ps aux | grep serv00sb | grep -v "grep" >/dev/null; then
nohup ./serv00sb run -c ./config.json >/dev/null 2>&1 &
fi
nohup ./serv00sb run -c ./config.json >/dev/null 2>&1 &

fi
export_list
if [ -z "$keep" ]; then
export_list
fi
6 changes: 4 additions & 2 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,13 @@ showSingBoxInfo(){
red "配置文件不存在,请先行配置!"
return
fi

if [ ! -e list ]; then
red "请先运行sing-box"
fi
cat ./list
config="singbox.json"
type=$(jq -r ".TYPE" $config)
chmod +x ./start.sh && ./start.sh $type list

}

writeWX(){
Expand Down

0 comments on commit cd8ed1e

Please sign in to comment.