Bob, glad you replied. Here's what I'm trying to do.
I can connect to the webdav via the osascript. I also don't like putting usernames and passwords in flat files, seems that keychains works for that anyway.
What I'm trying to do is this. We have a Synology Diskstation at work, many of us connect to it's Shared [network] Folders via Webdav. When we're in the office we like to connect directly on the LAN for improved connectivity. When remote we use an external address.
I've created this little script which tests to see if the Synology is local and if so connects to it directly on the LAN, if it's not found then it connects from the external IP address.
#!/bin/bash
echo
echo "about to ping LOCAL"
/sbin/ping -c 1 -t 5 LOCALIP
/sbin/ping -c 1 -t 5 LOCALIP &>/dev/null
if [ $? -eq 0 ]; then
echo
echo "About to mount to LOCAL Webdav..."
osascript -e ' mount volume "http://LOCALIP:WEBDAVPORT" '
else
echo "About to mount to ETERNAL Webdav..."
osascript -e ' mount volume "http://EXTERNALIP:WEBDAVPORT" '
fi
For all practical purposes this works great. The one drawback is that when connected locally the mounted webdav has the name LOCALIP, and when connected from outside of the office the webdav mounted drive has the name EXTERNALIP (it's actually the IP address like say 192.168.0.55). I'd so love it if I could connect locally or remotely and regardless of where I'm connecting from have the same webdav name. Say maybe WEBDAV as the connected file name.
I've tried to accomplish this by mkdir a folder in the Volumes directoy and try using the mount_webdav command but I flat out couldn't get it to work.
Really appreciate any help.