]> git.plutz.net Git - confetti/blob - actions/new_course.sh
pdflatex based generator for course lists
[confetti] / actions / new_course.sh
1 #!/bin/zsh
2
3 cgi_post
4
5 uid=$(dbus-uuidgen)
6 course="${uid}.ics"
7
8 tzid=$(cat /etc/timezone)
9 tstamp=$(TZ="$tzid" date +%Y%m%dT%H%M%S)
10
11 tempfile="$_DATA/temp/$course"
12
13 cat >"$tempfile" <<EOF
14 BEGIN:VCALENDAR
15 VERSION:2.0
16 PRODID:Berlin RAW Confetti
17 BEGIN:VEVENT
18 UID:$uid
19 DTSTAMP:TZID=${tzid}:${tstamp}
20 DTSTART:
21 DURATION:
22 RRULE:
23 SUMMARY:
24 COMMENT:
25 END:VEVENT
26 END:VCARD
27 EOF
28
29 echo -n "Location: http://$HTTP_HOST/?page=courses&edit=$course\n\n"