Files
cwsvJudo/shiai/mnt-magenta

17 lines
673 B
Plaintext
Executable File

# call to mount the magentacloud share via webdav
#! /usr/bin/env bash
# config variables
mountUser=$(whoami)
mntDir=~/mnt/magentacloud/judo.cwsv/
webdavUrl=https://magentacloud.de/remote.php/webdav
webdavUser=judo.cwsv@t-online.de
webdavPassword=$(pass show webdav/magentacloud/judo.cwsv@t-online.de)
# make sure sudo is enabled to nont get the sudo password prompt with the mount
sudo echo "sudo enabled!"
echo "Start mounting. This will take some seconds"
# pipe user/password to the mount
printf "${webdavUser}\n${webdavPassword}\n" | sudo mount -t davfs -o uid=$(id -u ${mountUser}),gid=$(id -g ${mountUser}) ${webdavUrl} ${mntDir} 1>/dev/null
echo "Mounting done!"