diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2020-03-17 19:18:39 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2020-03-17 19:18:39 +0100 |
| commit | 42f828801857fab8434701a8fb68b9ec44a959ad (patch) | |
| tree | 466878fd51c133b527e2062f35ff6c7840718b97 | |
| parent | ffe9bba96c5ae92a7aa91889ac4c794884177294 (diff) | |
| download | geldschieberbot-42f828801857fab8434701a8fb68b9ec44a959ad.tar.gz geldschieberbot-42f828801857fab8434701a8fb68b9ec44a959ad.zip | |
remove sample config and run script
| -rw-r--r-- | config.sh.sample | 16 | ||||
| -rwxr-xr-x | run.sh | 32 |
2 files changed, 0 insertions, 48 deletions
diff --git a/config.sh.sample b/config.sh.sample deleted file mode 100644 index a954658..0000000 --- a/config.sh.sample +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -# Group the bot should monitor -export GSB_GROUP_ID="" -# Path where the bots data should be stored -export GSB_STORE_PATH="~/geldschieberbot" -# Command the bot uses to send responses -export GSB_SEND_CMD="" -# Signal user the bot should use -export GSB_USER="" - -# create GSB_STORE_PATH -if [[ ! -e "$GSB_STORE_PATH" ]] -then - mkdir -p $GSB_STORE_PATH 2>/dev/null -fi @@ -1,32 +0,0 @@ -#!/bin/bash - -# Source config.sh if it is available -[[ -f config.sh ]] && source config.sh - -# Create dir for all your received messages -mkdir -p msgs - -# Is GSB_USER set ? -test -z "$GSB_USER" && >&2 echo "GSB_USER not set!" && exit 1 - -old_week=$(date +%U) -week=$(date +%U) - -while [ true ] -do - sleep 30 - - d=$(date -Ins) - week=$(date +%U) - - signal-cli -u ${GSB_USER} receive --json | tee msgs/msg${d}.log | python3 geldschieberbot.py - - # only keep non empty logs - [[ $(du msgs/msg${d}.log | cut -f 1) == 0 ]] && rm msgs/msg${d}.log - - # make a tar for every week - if [[ ${old_week} != ${week} ]] - then - tar cfz msgs/msgs$(date +%U-%g).tar.gz msgs/msg*.log && rm msgs/msg*.log && old_week=${week} - fi -done |
