reordered services and added new ones

This commit is contained in:
celso 2023-10-06 01:50:51 -03:00
parent 551cc4078e
commit 26303edf63
1 changed files with 13 additions and 4 deletions

17
bot.sh
View File

@ -45,12 +45,16 @@ while [ "${1}" == "start" ]; do
editmsg "${curmsg[chat_id]}" "${curmsg[msg_id]}" "checking again." editmsg "${curmsg[chat_id]}" "${curmsg[msg_id]}" "checking again."
__ip="$(./getip.sh "${bot_tmpdir}")" __ip="$(./getip.sh "${bot_tmpdir}")"
editmsg "${curmsg[chat_id]}" "${curmsg[msg_id]}" "checking again.." 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 \ ps -w -w -U syncplay -o args= | grep "syncplay-server" >/dev/null \
&& __syncplay_status="online" || __syncplay_status="offline" && __syncplay_status="online" || __syncplay_status="offline"
editmsg "${curmsg[chat_id]}" "${curmsg[msg_id]}" "checking again..." editmsg "${curmsg[chat_id]}" "${curmsg[msg_id]}" "checking again..."
ps -w -w -U steam -o args= | grep "hlds_linux" >/dev/null \ ps -w -w -U steam -o args= | grep "hlds_linux" >/dev/null \
&& __cstrike_status="online" || __cstrike_status="offline" && __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 unset curmsg
declare -A curmsg declare -A curmsg
getmsg_content curmsg sentmsgs.txt getmsg_content curmsg sentmsgs.txt
@ -58,11 +62,16 @@ while [ "${1}" == "start" ]; do
} }
[ "${curmsg[text]}" == "/start" ] && { [ "${curmsg[text]}" == "/start" ] && {
__ip="$(./getip.sh "${bot_tmpdir}")" __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" && __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" && __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 unset curmsg
declare -A curmsg declare -A curmsg
getmsg_content curmsg sentmsgs.txt getmsg_content curmsg sentmsgs.txt