davical.sh
562 Bytes
#/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $DIR/config.sh
COOKIES=$(mktemp)
FILE=$(mktemp)
$DIR/parse.py $ANNEE $EDT -o $FILE
curl --data "username=$USERNAME&password=$PASSWORD" \
--cookie-jar $COOKIES \
$BASELINK/ > /dev/null
curl -v \
-F "collection_id=$CID" \
-F "ics_file=@$FILE;type=text/calendar" \
-F "mode=off" \
-F "_editor_action[editor_1]=update" \
-F "submit=true" \
--cookie $COOKIES \
"$BASELINK/admin.php?action=edit&t=collection&id=$CID" > /dev/null
rm $COOKIES $FILE