#!/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: ).*(?=)' data/last_proto > data/redeleitung grep -oP '(?<=nächstes Protokoll: ).*(?=)' data/last_proto > data/protokoll