aboutsummaryrefslogtreecommitdiffstats
path: root/hyperbot
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
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')
-rwxr-xr-xhyperbot49
1 files changed, 49 insertions, 0 deletions
diff --git a/hyperbot b/hyperbot
new file mode 100755
index 0000000..1466ff2
--- /dev/null
+++ b/hyperbot
@@ -0,0 +1,49 @@
+#! /bin/bash
+
+if [[ "${1}" == 'start' ]]
+then
+ declare -a pids
+
+ cd /srv/hyperbot/
+
+ ./envbot &
+ pids[0]=$!
+
+ ./hyperbot_fixer &
+ pids[1]=$!
+
+ ./issues_change_detector &
+ pids[2]=$!
+
+ function closedown
+ {
+ for pid in ${pids[@]}
+ do
+ kill $pid
+ done
+
+ exit
+ }
+
+ trap "closedown" SIGINT SIGTERM
+
+ while true
+ do
+ sleep 5h
+ done
+elif [[ "${1}" == 'stop' ]]
+then
+ while true
+ do
+ pid=$(pgrep -u hyperbot | head -1)
+
+ if [[ -n "${pid}" ]]
+ then
+ kill ${pid} &>/dev/null
+ else
+ exit
+ fi
+ done
+else
+ echo "first arg must be \`start' or \`stop'"
+fi