aboutsummaryrefslogtreecommitdiffstats
path: root/hyperbot_fixer
diff options
context:
space:
mode:
authorMárcio Silva <coadde at hyperbola dot info>2017-06-02 15:48:13 -0300
committerMárcio Silva <coadde at hyperbola dot info>2017-06-02 17:12:07 -0300
commitae928016bf637b26326ec335b10898c6c2b0e4b9 (patch)
tree98fa3a0180c9eba01d3b9082373e7a402c3f632e /hyperbot_fixer
parentb4830e97ae51396ccaa9ca2acb469aef80094ae8 (diff)
downloadhyperbot-ae928016bf637b26326ec335b10898c6c2b0e4b9.tar.lz
hyperbot-ae928016bf637b26326ec335b10898c6c2b0e4b9.tar.xz
hyperbot-ae928016bf637b26326ec335b10898c6c2b0e4b9.zip
Import some files from pbot-ng project and branding this project to hyperbot
Diffstat (limited to 'hyperbot_fixer')
-rwxr-xr-xhyperbot_fixer24
1 files changed, 24 insertions, 0 deletions
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