From 3da98411c3ebbb3cc7f8f54c064043d689a9e426 Mon Sep 17 00:00:00 2001 From: denode Date: Mon, 23 Mar 2026 13:09:00 +0100 Subject: [PATCH] Add motd.sh --- motd.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 motd.sh diff --git a/motd.sh b/motd.sh new file mode 100644 index 0000000..2be8538 --- /dev/null +++ b/motd.sh @@ -0,0 +1,11 @@ +function motd() { + #6 - matrix; 25 - zelt; 32 - Johanna + mensen=(32) + for mensa in "${mensen[@]}"; do + curl -s https://api.studentenwerk-dresden.de/openmensa/v2/canteens/$mensa | jq -r .name + while read meal; do + echo "$(echo "$meal" | awk -F '$' '{print $2}') € $(echo "$meal" | awk -F '$' '{print $1}')" + done < <(curl -s https://api.studentenwerk-dresden.de/openmensa/v2/canteens/$mensa/days/$(date "+%Y-%m-%d")/meals | jq -r '.[] | "\(.name)$\(.prices.Studierende)$\(.notes)"' | grep -E "vegan|vegetarisch" | grep -v suppe) + done +} +motd \ No newline at end of file