From b5898106657c3fac6ae4b8eba1516e74dd43054c Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sun, 20 Aug 2017 18:07:17 +0200 Subject: add run.sh script --- Readme.md | 5 ++--- run.sh | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) create mode 100755 run.sh 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 -- cgit v1.2.3