Hi,

I have created a small bash script, to easily create nicer public calendar urls, and and keep them updated if you run the script with crontab.

It's nothing fancy AT ALL, but perhaps it helps someone. The script is below.

It requires a config file in the following form:

nice.ics http://webmail.company.com/SOGo/dav/public/calendars/Calendar/38C2-543FAA00-1D-27687B80.ics

It will download the ics file, and save it as nice.ics in a defined location, so the address could become:

http://webmail.company.com/calendars/nice.ics

Again: its nothing special, but it helps us, and perhaps others too.

Best wishes for 2016 to everybody here!
MJ

The script:

#!/bin/bash

TARGET_DIR=/var/www/calendars
CALENDAR_LIST=/etc/sogo/public-calendars.conf

mapfile -t CALENDAR < $CALENDAR_LIST

tLen=${#CALENDAR[@]}

for (( i=0; i<${tLen}; i++ ));
do

    IFS=" "
    set ${CALENDAR[i]}
    PRETTY=$1
    UGLY=$2

    rm -f "$TARGET_DIR/$PRETTY"
    wget "-O" "$TARGET_DIR/$PRETTY" "$UGLY"

done

--
users@sogo.nu
https://inverse.ca/sogo/lists

Reply via email to