AFP mounting Errors

Hello All,

I've have created a script today that will mount my shared afp volumes to my system successfully, however, I've come across a very interesting issue that I can't seem to get by, so maybe someone will be kind enough to lend some advice. I am working on OS X 10.6.4 and using the terminal. Here's my problem.

To mount an AFP drive, the command I use in the terminal is:
:mkdir /Volumes/DriveName
:mount -t afp afp://Username:Password@10.0.0.1/DriveName /Volumes/DriveName

Works GREAT!:smiley: When I use this code in my .sh script, it works as expected ONLY if at least one other volume has been mounted from the shared storage. KICKER If I am trying to mount the FIRST volume to the system I get the following error:
mount_afp: AFPMountURL returned error -5023, errno is -5023
(does anyone know of a place to get information on these error codes?)

What I don't understand is that when I do this manually without the script and no other volumes are mounted I do not get this error. When I run the script and at least one volume is mounted I do not get this error. Only when I have no other volumes mounted at all and I run my script, I get this error. I can recreate this error over and over again.

If anyone has any ideas on how to get around this issue it would be really helpful. This is an unusual issue that I'm not accustom to. I'm not a rookie at shell scripting, but I don't claim to be an expert. If I need to post the script I will be glad to do so. Thanks for any help.

Cheers,
Stephen

How exactly are you running the script? Also, could you post the whole script so I could take a look at it?