get uvproto dynamically from a script, also show if protos have TODOs
This commit is contained in:
@@ -17,6 +17,7 @@ pre_tops:
|
|||||||
{% endfor %}'
|
{% endfor %}'
|
||||||
- title: Unveröffentlichte Protokolle
|
- title: Unveröffentlichte Protokolle
|
||||||
file: "data/uvproto.txt"
|
file: "data/uvproto.txt"
|
||||||
|
command: ./get_uvproto.sh
|
||||||
body: "* FSR-Protokoll vom {{last_date|date}}"
|
body: "* FSR-Protokoll vom {{last_date|date}}"
|
||||||
- title: Berichte
|
- title: Berichte
|
||||||
protostub:
|
protostub:
|
||||||
|
|||||||
17
get_uvproto.sh
Executable file
17
get_uvproto.sh
Executable file
@@ -0,0 +1,17 @@
|
|||||||
|
#!/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"
|
||||||
Reference in New Issue
Block a user