Blame view

davical.sh 562 Bytes
c7b78710   Geoffrey PREUD'HOMME   Possibilité d'env...
1
2
  #/bin/env bash
  
41bea6b4   Geoffrey PREUD'HOMME   Relative path for...
3
4
5
  DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
  
  source $DIR/config.sh
c7b78710   Geoffrey PREUD'HOMME   Possibilité d'env...
6
7
8
9
  
  COOKIES=$(mktemp)
  FILE=$(mktemp)
  
d04ef93f   Geoffrey PREUD'HOMME   davical: Support ...
10
  $DIR/parse.py $ANNEE $EDT -o $FILE
c7b78710   Geoffrey PREUD'HOMME   Possibilité d'env...
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
  
  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