Webdav

From Torben's Wiki
Jump to navigationJump to search

Mounting Webdav (Linux)

A nice script can be found here: [1]. And an Ubuntu Howto here: [2]

My solution is a bit different, not requiring root permissions

sudo apt-get install ca-certificates davfs2
sudo dpkg-reconfigure davfs2
# --> Enter yes
sudo mkdir /media/gmx-mc
sudo chown torben:torben /media/gmx-mc
#Add user to group davfs2 
sudo adduser torben davfs2 

in /ets/fstab add

https://mediacenter.gmx.net /media/gmx-mc davfs noauto,user,rw,uid=torben,gid=torben 0 0

The Error "File exists" on writing files can in Ubuntu be fixed by editing /etc/davfs2/davfs2.conf and adding

if_match_bug 1


Accessing Horde Calendar on Webdav

  • we first use a dialog to ask for the password
  • than cadever is used for uploading (overwriting) a file (calendar)
TEMPFILE=`tempfile`
dialog --title "Passwords"\
  --insecure --passwordbox "tmenke@Horde" 10 50\
  2>$TEMPFILE

if [ $? -eq 0 ]; then
  echo " ==> uploading joined calendar"
  HORDE_PASSWD=`cat $TEMPFILE`
  rm $TEMPFILE
  # write login data into .netrc for cadaver
  echo -en "machine my.mailserver.de\nlogin torben\npasswd $HORDE_PASSWD" > ~/.netrc
  echo -e "put /home/torben/.kde/share/apps/korganizer/cal.ics torben.ics" | cadaver https://my.mailserver.de/horde/ rpc.php/kronolith/torben/
  rm ~/.netrc # !!!
fi