Commit c7b78710e49cbedfcb29dd497e892177cdb60f7c

Authored by Geoffrey PREUD'HOMME
1 parent 82e73c44

Possibilité d'envoyer le calendrier sur un serveur DaviCAL

Showing 3 changed files with 29 additions and 0 deletions   Show diff stats
.gitignore
... ... @@ -92,3 +92,4 @@ ENV/
92 92 # Custom
93 93 *.html
94 94 *.ics
  95 +config.sh
... ...
config.sh.example 0 → 100644
... ... @@ -0,0 +1,5 @@
  1 +EDT=groupe12
  2 +CID=1234
  3 +BASELINK='https://davserver.tld/'
  4 +USERNAME=username
  5 +PASSWORD='password'
... ...
davical.sh 0 → 100755
... ... @@ -0,0 +1,23 @@
  1 +#/bin/env bash
  2 +
  3 +source config.sh
  4 +
  5 +COOKIES=$(mktemp)
  6 +FILE=$(mktemp)
  7 +
  8 +./parse.py $EDT -o $FILE
  9 +
  10 +curl --data "username=$USERNAME&password=$PASSWORD" \
  11 + --cookie-jar $COOKIES \
  12 + $BASELINK/ > /dev/null
  13 +
  14 +curl -v \
  15 + -F "collection_id=$CID" \
  16 + -F "ics_file=@$FILE;type=text/calendar" \
  17 + -F "mode=off" \
  18 + -F "_editor_action[editor_1]=update" \
  19 + -F "submit=true" \
  20 + --cookie $COOKIES \
  21 + "$BASELINK/admin.php?action=edit&t=collection&id=$CID" > /dev/null
  22 +
  23 +rm $COOKIES $FILE
... ...