#!/bin/bash
DIRECTORY=$(cd `dirname $0` && pwd)
THISDIR=`basename "$DIRECTORY"`
TODIR=$(cd $DIRECTORY/.. && pwd)
echo "From $DIRECTORY to $TODIR for $THISDIR"
SCRIPT="Redirect 301 /.well-known/caldav /$THISDIR/dav \nRedirect 301 /.well-known/carddav /$THISDIR/dav"
echo -e $SCRIPT
echo -e $SCRIPT > $TODIR/.htaccess
