From 26303edf63efc16f140408834822976d1f4b08fa Mon Sep 17 00:00:00 2001 From: celso Date: Fri, 6 Oct 2023 01:50:51 -0300 Subject: [PATCH] reordered services and added new ones --- bot.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/bot.sh b/bot.sh index 5095bd7..1ee2fd9 100755 --- a/bot.sh +++ b/bot.sh @@ -45,12 +45,16 @@ while [ "${1}" == "start" ]; do editmsg "${curmsg[chat_id]}" "${curmsg[msg_id]}" "checking again." __ip="$(./getip.sh "${bot_tmpdir}")" editmsg "${curmsg[chat_id]}" "${curmsg[msg_id]}" "checking again.." + ps -w -w -U steam -o args= | grep "TShock.Server" >/dev/null \ + && __terraria_status="online" || __terraria_status="offline" + ps -w -w -U steam -o args= | grep "factorio" >/dev/null \ + && __factorio_status="online" || __factorio_status="offline" ps -w -w -U syncplay -o args= | grep "syncplay-server" >/dev/null \ && __syncplay_status="online" || __syncplay_status="offline" editmsg "${curmsg[chat_id]}" "${curmsg[msg_id]}" "checking again..." ps -w -w -U steam -o args= | grep "hlds_linux" >/dev/null \ && __cstrike_status="online" || __cstrike_status="offline" - editmsg "${curmsg[chat_id]}" "${curmsg[msg_id]}" "${__ip}%0Asyncplay(${__syncplay_status}): port 60000%0Acstrike(${__cstrike_status}): port 64000" "${inline_kbd}" + editmsg "${curmsg[chat_id]}" "${curmsg[msg_id]}" "${__ip}%0Aterraria(${__terraria_status}): port 7777%0Afactorio(${__factorio_status}: port 34197%0Asyncplay(${__syncplay_status}): port 60000%0Acstrike(${__cstrike_status}): port 64000" "${inline_kbd}" unset curmsg declare -A curmsg getmsg_content curmsg sentmsgs.txt @@ -58,11 +62,16 @@ while [ "${1}" == "start" ]; do } [ "${curmsg[text]}" == "/start" ] && { __ip="$(./getip.sh "${bot_tmpdir}")" - ps -w -w -U syncplay -o args= | grep "syncplay-server" >/dev/null\ + ps -w -w -U steam -o args= | grep "TShock.Server" >/dev/null \ + && __terraria_status="online" || __terraria_status="offline" + ps -w -w -U steam -o args= | grep "factorio" >/dev/null \ + && __factorio_status="online" || __factorio_status="offline" + ps -w -w -U syncplay -o args= | grep "syncplay-server" >/dev/null \ && __syncplay_status="online" || __syncplay_status="offline" - ps -w -w -U steam -o args= | grep "hlds_run" >/dev/null\ + editmsg "${curmsg[chat_id]}" "${curmsg[msg_id]}" "checking again..." + ps -w -w -U steam -o args= | grep "hlds_linux" >/dev/null \ && __cstrike_status="online" || __cstrike_status="offline" - sendmsg "${curmsg[chat_id]}" "${__ip}%0Asyncplay(${__syncplay_status}): port 60000%0Acstrike(${__cstrike_status}): port 64000" "${inline_kbd}" + sendmsg "${curmsg[chat_id]}" "${__ip}%0Aterraria(${__terraria_status}): port 7777%0Afactorio(${__factorio_status}: port 34197%0Asyncplay(${__syncplay_status}): port 60000%0Acstrike(${__cstrike_status}): port 64000" "${inline_kbd}" unset curmsg declare -A curmsg getmsg_content curmsg sentmsgs.txt