* move all scripts not intended to be called directly to helpers/ dir * introduce sequencer.py as replacement for various scripts * introduce --save option to generate.py * other smaller changes/bugfixes
18 lines
586 B
Bash
Executable File
18 lines
586 B
Bash
Executable File
#!/bin/sh
|
|
set -e
|
|
|
|
: "${FSR_GEN_SSH_TO:=fsmi-login.fsmi.uni-karlsruhe.de}"
|
|
: "${FSR_GEN_SSH:=$(test "$(hostname -d)" = "fsmi.uni-karlsruhe.de" || echo 1)}"
|
|
|
|
QUERY="select '* FSR-Protokoll vom '||datum|| case when protokoll like '%TODO%' then ' (hat noch TODOs)' else '' end from protokolle where ist_veroeffentlicht=false and name is null order by datum asc"
|
|
|
|
cmd="psql --no-align --tuples-only service=fsmi -c \"$QUERY\""
|
|
|
|
if [ -z "$FSR_GEN_SSH" ] || [ "$FSR_GEN_SSH" -eq 0 ]; then
|
|
raw_proto="$(sh -c "$cmd")"
|
|
else
|
|
raw_proto="$(ssh -- "$FSR_GEN_SSH_TO" "$cmd")"
|
|
fi
|
|
|
|
echo "$raw_proto"
|