Initial commit

This commit is contained in:
Philipp Matthias Schaefer 2020-05-16 22:23:22 +02:00
commit c82447cf7a
4 changed files with 62 additions and 0 deletions

19
email_text Normal file
View file

@ -0,0 +1,19 @@
Hallo,
am PROSEDATE findet wieder ein Plenum statt. Wir treffen uns um 20 Uhr im virtuellen Raum unter
https://blue.kabi.tk/b/hac-nuf-fp4
Das Protokoll wird unter
https://vereinte.verwirrung.institute/p/ksplenum-URLDATE
geführt werden. Dieses muss noch auf Basis der Vorlage
https://vereinte.verwirrung.institute/p/ksplenum-template
vorbereitet werden (Anleitung dort zu finden).
Grüße,
das Einladeskript

29
invite.sh Executable file
View file

@ -0,0 +1,29 @@
#!/usr/bin/bash
## Configuration
from="office@krautspace.de"
to="hackspace-jena@lstsrv.org"
subject="Einladung zum Plenum"
body_file=email_text # Use PROSEDATE for dd.mm.YYYY and URLDATE for YYYmmdd
## Find next Thursday
day_of_week=$(date +%u)
next_thursday_offset=$(( ( ( 7 - $day_of_week ) + 4 ) % 7 ))
## Check if next Thursday is the first of a month
if (( $(date +%d) > 7 )); then
echo "Invitation should be sent at most a week in advance."
echo "Exiting without sending an inviation..."
exit
fi
## Send inviation
prose_date=$(date -d "+$next_thursday_offset days" +%d.%m.%Y)
url_date=$(date -d "+$next_thursday_offset days" +%Y%m%d)
cat "$body_file" | sed -e "s/PROSEDATE/$prose_date/g" | sed -e "s/URLDATE/$url_date/g" | mail -s "$subject" -r "$from" "$to"

6
plenums_invite.service Normal file
View file

@ -0,0 +1,6 @@
[Unit]
Description=Send invitation to Hackspace's Plenum
[Service]
Type=oneshot
ExecStart=/opt/plenums_invite/invite.sh

8
plenums_invite.timer Normal file
View file

@ -0,0 +1,8 @@
[Unit]
Description=Monthly invite to Hackspace's Plenum
[Timer]
OnCalendar=Mon 15:00
[Install]
WantedBy=timers.target