Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

costabunny

macrumors 68020
Original poster
I have a script that mounts my media server at startup. Its fine with the MBA but not on the mac pro as it seems the os boots so quick it calls the script before the network is fully up :S

I get a no route to host error. If i fire up a shell and re-run the script myself, it mounts fine.

Is there any way to have this mount script run a little later (and I did try a wait 10 in it - same issue)

? Confused (tho it is bloody scarey just how fast the mac pro boots to a ready state ! )
 
call me stupid but it that apple script or shell (as ive not used 'delay' in shell scripts before and my shell seems to reject it)

perhaps my script would help

#!/bin/ksh
mount_smbfs //10.10.10.10:/public Desktop/Adama
 
Code:
delay xx

Where xx is the amount of time. For example:

Code:
delay 30

Will delay for 30 seconds.

call me stupid but it that apple script or shell (as ive not used 'delay' in shell scripts before and my shell seems to reject it)

perhaps my script would help

Use sleep instead of delay.

From the manual page:

Code:
SLEEP(1)                  BSD General Commands Manual                 SLEEP(1)

NAME
     sleep -- suspend execution for an interval of time

SYNOPSIS
     sleep seconds

DESCRIPTION
     The sleep utility suspends execution for a minimum of seconds.  It is usually used to schedule the execution of
     other commands (see EXAMPLES below).

     The sleep utility exits with one of the following values:

     0     On successful completion, or if the signal SIGALRM was received.

     >0    An error occurred.

EXAMPLES
     To schedule the execution of a command for x number seconds later:

           (sleep 1800; sh command_file >& errors)&
 
Ok so I used a sleep 10 instead of sleep 7 and for some reason on the last bootup it works - wayhay!

still I guess I could make it smarter by checking if the net interface is fully up.

(The same script on my MBA checks to see if its in my Home SSID before executing the mount statement)

🙂
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.