Skip to content

Commit

Permalink
暂停保活只是删掉cron记录,没有删掉保活配置文件,这就导致action调用保活时误认为有设置保活
Browse files Browse the repository at this point in the history
但cron记录被删除。本次修复此问题。
  • Loading branch information
frankiejun committed Nov 26, 2024
1 parent aac6a1f commit 923e9d8
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,16 @@ createConfigFile(){
;;
88)
delCron
backupConfig "config.json"
green "设置完毕!"
return 0
;;
99)
if [[ ! -e config.json ]]; then
if [[ ! -e config.bak ]]; then
red "之前未有配置,未能复通!"
return 1
fi
restoreConfig "config.bak"
tm=$(jq -r ".chktime" config.json)
addCron $tm
green "设置完毕!"
Expand Down Expand Up @@ -236,6 +238,26 @@ done

}

backupConfig(){
local filename=$1
if [[ -e "$filename" ]]; then
if [[ "$filename" =~ ".json" ]]; then
local basename=${filename%.json}
mv $filename $basename.bak
fi
fi
}

restoreConfig(){
local filename=$1
if [[ -e "$filename" ]]; then
if [[ "$filename" =~ ".bak" ]]; then
local basename=${filename%.bak}
mv $filename $basename.json
fi
fi
}

make_vmess_config() {
cat >tempvmess.json <<EOF
{
Expand Down

0 comments on commit 923e9d8

Please sign in to comment.