Import some files from pbot-ng project and branding this project to hyperbot

This commit is contained in:
Márcio Silva
2017-06-02 15:48:13 -03:00
parent b4830e97ae
commit ae928016bf
44 changed files with 1225 additions and 12 deletions

24
hyperbot_fixer Executable file
View File

@@ -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