Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
frankiejun committed Aug 13, 2024
1 parent 48b8eef commit 2c64a97
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
14 changes: 6 additions & 8 deletions keepalive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,29 +35,27 @@ checkvmessAlive() {
#main
cd ${installpath}/serv00-play/
if [ ! -f config.json ]; then
echo "未配置保活项目,请先行配置!"
echo "未配置保活项目,请先行配置!" >>a.log
exit 0
fi
monitor=$(jq -r ".item[]" config.json)
for obj in $monitor; do
cd ${installpath}/serv00-play/
echo "obj: $obj"
for obj in "${monitor[@]}"; do
if [ "$obj" == "vless" ]; then
if ! checkvlessAlive; then
cd ${installpath}/serv00-play/vless
if ! ./start.sh; then
echo "RESPONSE:vless restarted failure."
echo "RESPONSE:vless restarts failure."
else
echo "RESPONSE:vless restarted successfully."
echo "RESPONSE:vless restarts successfully."
fi
fi
elif [ "$obj" == "vmess" ]; then
if ! checkvmessAlive; then
cd ${installpath}/serv00-play/vmess
if ! ./start.sh; then
echo "RESPONSE:vmess restarted failure."
echo "vmess restarts failure."
else
echo "RESPONSE:vmess restarted successfully."
echo "vmess restarts successfully."
fi
fi
fi
Expand Down
2 changes: 1 addition & 1 deletion revive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ sendtype=$SENDTYPE
#}'
#echo "host info:$HOSTS_JSON"
# 使用 jq 提取 JSON 数组,并将其加载为 Bash 数组
mapfile -t hosts_info < <(echo "${HOSTS_JSON}" | jq -r ".info[]")
hosts_info=($(echo "${HOSTS_JSON}" | jq -c ".info[]"))

for info in "${hosts_info[@]}"; do
user=$(echo $info | jq -r ".username")
Expand Down

0 comments on commit 2c64a97

Please sign in to comment.