From ae928016bf637b26326ec335b10898c6c2b0e4b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rcio=20Silva?= Date: Fri, 2 Jun 2017 15:48:13 -0300 Subject: Import some files from pbot-ng project and branding this project to hyperbot --- hyperbot_fixer | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 hyperbot_fixer (limited to 'hyperbot_fixer') diff --git a/hyperbot_fixer b/hyperbot_fixer new file mode 100755 index 0000000..3647660 --- /dev/null +++ b/hyperbot_fixer @@ -0,0 +1,24 @@ +#! /bin/bash + +while true +do + sleep 30m + + # If nothing has been written to the log for 30 minutes then we assume + # hyperbot is dead. + if [[ -z $(find logs/ -iname 'raw.log' -mmin -30) ]] + then + # Kill all hyperbot processes + while read -r line + do + # If it's not the pid of this process then kill it. + [[ "${line}" != "$$" ]] && kill "${line}" &>/dev/null + done < <( pgrep -u hyperbot ) + + # Start hyperbot + cd /srv/hyperbot + + ./envbot & + ./issues_change_detector & + fi +done -- cgit v1.2.3