aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2017-08-20 18:07:17 +0200
committerFlorian Fischer <florian.fl.fischer@fau.de>2017-08-20 18:07:17 +0200
commitb5898106657c3fac6ae4b8eba1516e74dd43054c (patch)
treee635bd1817e58b627e54fd294ae1cb71bb386c29
parentff93952d178eba2ba90c10b1c26905eccb63263b (diff)
downloadgeldschieberbot-b5898106657c3fac6ae4b8eba1516e74dd43054c.tar.gz
geldschieberbot-b5898106657c3fac6ae4b8eba1516e74dd43054c.zip
add run.sh script
-rw-r--r--Readme.md5
-rwxr-xr-xrun.sh16
2 files changed, 18 insertions, 3 deletions
diff --git a/Readme.md b/Readme.md
index 3157425..16c360d 100644
--- a/Readme.md
+++ b/Readme.md
@@ -11,11 +11,10 @@ Geldschieberbot is configured with a set of Environment variables:
* GSB_GROUP_ID the signal group_id you want to serve
* GSB_STORE_PATH the directory where Geldschieberbot stores the balance and the useres
* GSB_SEND_CMD the command Geldschieberbot uses to send replies
+* GSB_USER the mobile number signal-cli should receive messages with
Geldschieberbot must be fed with signal messages recieved by signal-cli.
-Just pipe the output of signal-cli receive through Geldschieberbot in a cron
-job and you are good to go.
-
+Just execute run.sh in tmux and you should be fine.
Happy Geldschieben!
diff --git a/run.sh b/run.sh
new file mode 100755
index 0000000..2dc725f
--- /dev/null
+++ b/run.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+i=1
+a=1
+while [ true ]
+do
+ sleep 30
+ echo $i
+ signal-cli -u $GSB_USER receive | tee msg$i.log | python3 geldschieberbot.py
+ i=`expr $i + 1`
+
+ if [[ $i == 5000 ]]
+ then
+ tar cfz msgs$a.tar.gz msg*.log && rm msg*.log && i=1 && a=`expr $a + 1`
+ fi
+done