SInce you are using a shell script, why not just create a symbolic link to the mounted webdav?
...
rm -f /Volume/WEBDAV
if [ $? -eq 0 ]; then
echo
echo "About to mount to LOCAL Webdav..."
osascript -e ' mount volume "http://LOCALIP:WEBDAVPORT" '
ln -s /path/to/local/webdav.mount.point /Volume/WEBDAV
else
echo "About to mount to ETERNAL Webdav..."
osascript -e ' mount volume "http://EXTERNALIP:WEBDAVPORT" '
ln -s /path/to/remote/webdav.mount.point /Volume/WEBDAV
fi
Now you have a constant name at a contant location. The location could be anywhere you like, I just exampled using /Volumes/WEBDAV
If you want to actually give this your own mount point then you need to look at not using osascript and start looking at the Unix mount command. See "man mount_webdav"
mkdir -p /Volumes/WEBDAV
mount -t webdav http://LOCALIP:WEBDAVPORT /Volumes/WEBDAV
However, I'm unsure if stored credentials will be used (I suspect not 😟)
If there is a way to do this via Applescript (which is basically all the osascript was doing), I do not know it. I'm not saying a way does not exist, I'm just saying my Applescript skills stink 🙂
One other idea. Use the Unix ""mount -t webdav command once for local and once for remote. Once you have it mounted where you want it, use the Finder to create a Mac OS X "Alias". Finder -> File -> Make Alias (rename the alias as desired). This should incorporate all the connection information (I hope). You should now have a local "Alias" and a "Remote" alias. When you double click on the Alias, it should hopefully mount the webdav as it was when the Alias was created. If authenticaion is needed the Alias should handle that. NOTE: Never tried this with webdav, and never tried this with using the Unix "mount -t webdav" command. So I'm not sure it will work or not.
Message was edited by: BobHarris