summaryrefslogtreecommitdiffstats
path: root/bind-cal.sh
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2015-10-26 17:11:38 +0100
committerFlorian Pritz <bluewind@xinu.at>2015-10-26 17:11:38 +0100
commitec54b9528b2eb32d5775bc1ff3566f1e2e2db955 (patch)
treefaafce0250705f97785b0bf30b092f9e27362fe3 /bind-cal.sh
parent1c304f96c427d3538934fffa075ab50d7ab7d64a (diff)
downloadbin-ec54b9528b2eb32d5775bc1ff3566f1e2e2db955.tar.gz
bin-ec54b9528b2eb32d5775bc1ff3566f1e2e2db955.tar.xz
Add new scripts
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'bind-cal.sh')
-rwxr-xr-xbind-cal.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/bind-cal.sh b/bind-cal.sh
new file mode 100755
index 0000000..555560f
--- /dev/null
+++ b/bind-cal.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+BASE="$1"
+USER="$2"
+RESOURCE="$3"
+NAME="${4:-${3##*/}}"
+
+URL="$BASE/caldav.php/$USER/"
+
+RESSOURCE=$(echo "$RESSOURCE" | php -e '<?php echo file_get_contents("php://stdin")')
+
+
+REQUEST=`cat <<EOF
+<?xml version="1.0" encoding="utf-8"?>
+<bind xmlns="DAV:">
+ <segment>$NAME</segment>
+ <href>$RESOURCE</href>
+</bind>
+EOF`
+
+echo $REQUEST
+
+echo $REQUEST | curl -k -d @- -X BIND -u $USER -H "content-type: text/xml;charset=\"UTF-8\"" -H "user-agent: bind-script" $URL