bugfix master
authorBernhard Tittelbach <bernhard@tittelbach.org>
Tue, 15 Sep 2026 17:16:23 +0000 (19:16 +0200)
committerBernhard Tittelbach <bernhard@tittelbach.org>
Tue, 15 Sep 2026 17:16:23 +0000 (19:16 +0200)
ansible/roles/web/r3status/templates/cache_realraum_imported_calendar.sh.j2

index 5255559..a8fea15 100755 (executable)
@@ -23,7 +23,6 @@ function get_merge_ics
   shift
   local sources=("$@")
   {
-    # Emit a VCALENDAR header
     echo "BEGIN:VCALENDAR"
     echo "VERSION:2.0"
     echo "PRODID:-//merge-ics//zsh//lauti.org//EN"
@@ -32,17 +31,14 @@ function get_merge_ics
     # For each .ics file, strip the outer VCALENDAR block but keep events
     for s in "$sources[@]"; do
       [[ -n $s ]] || continue
-      # Remove BEGIN:VCALENDAR / END:VCALENDAR lines (and their associated
-      # header properties like VERSION, PRODID, CALSCALE, X-WR-CALNAME)
-      # by extracting only the VEVENT (and VTODO/VALARM) blocks.
-  awk '
-        /^BEGIN:V(EVENT|TODO|TIMEZONE)/ { print; inblock=1; depth=0 }
+      awk '
+        /^BEGIN:V(EVENT|TODO|TIMEZONE)/ { inblock=1; depth=1; print; next }
         inblock {
           if      (/^BEGIN:/) depth++
           else if (/^END:/)   { depth--; if (depth==0) inblock=0 }
           print
         }
-      ' =( wget --no-check-certificate -o /dev/null --tries=1 "$s" --quiet -o /dev/null -O - 2>/dev/null)
+      ' =( wget --no-check-certificate --tries=1 "$s" --quiet -o /dev/null -O - 2>/dev/null )
       echo
     done
 
@@ -50,8 +46,6 @@ function get_merge_ics
   } >! "$out"
 }
 
-
-
 mkdir $APACHE_PATH 2>/dev/null
 mkdir $DL_PATH 2>/dev/null
 ### sed makes ical validate according to http://severinghaus.org/projects/icv/?url=https%3A%2F%2Fr3.at%2Fevents.ical