add script to extract top mails

This commit is contained in:
2021-04-20 20:44:23 +02:00
parent 1d611aecd6
commit eb58ae463f
2 changed files with 52 additions and 1 deletions

View File

@@ -2,12 +2,13 @@
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)
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 order by datum asc\"" 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"
echo "$proto" > data/last_date
done > data/uvproto.txt
grep -oP '(?<=nächste Redeleitung: ).*(?=</li>)' data/last_proto > data/redeleitung