only read fsr protocols, ignore others. also cleanup

This commit is contained in:
2021-03-11 13:40:09 +01:00
parent fb0d174dcb
commit c8404fa255
8 changed files with 37 additions and 100 deletions

14
read_db.sh Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/bash -e
read -s -p "DB-Passwort: " password;
echo
raw_proto=$(echo $password | ssh fsmi "psql -A -t -h fsmi-db fsmi -c \"select datum from protokolle where ist_veroeffentlicht='f' and name is null\"" 2> /dev/null)
echo $password | ssh fsmi "psql -A -t -h fsmi-db fsmi -c \"select protokoll from protokolle where ist_veroeffentlicht='f' and name is null order by datum desc limit 1\"" 2> /dev/null > data/last_proto
for proto in $raw_proto;
do
echo "* FSR-Protokoll vom $proto"
done > data/uvproto.txt
grep -oP '(?<=nächste Redeleitung: ).*(?=</li>)' data/last_proto > data/redeleitung
grep -oP '(?<=nächstes Protokoll: ).*(?=</li>)' data/last_proto > data/protokoll