Mount failing due to Mac booting too damnd fast :S

Discussion in 'macOS' started by costabunny, Jun 27, 2008.

  1. costabunny macrumors 68020

    costabunny

    Joined:
    May 15, 2008
    Location:
    ~/bunny/
    #1
    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 ! )
     
  2. macintosh tech macrumors member

    Joined:
    Apr 28, 2008
    #2
    Code:
    delay xx
    Where xx is the amount of time. For example:

    Code:
    delay 30
    Will delay for 30 seconds.
     
  3. costabunny thread starter macrumors 68020

    costabunny

    Joined:
    May 15, 2008
    Location:
    ~/bunny/
    #3
    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

     
  4. JNB macrumors 604

    JNB

    Joined:
    Oct 7, 2004
    Location:
    In a Hell predominately of my own making
    #4
    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)&
     
  5. macintosh tech macrumors member

    Joined:
    Apr 28, 2008
  6. costabunny thread starter macrumors 68020

    costabunny

    Joined:
    May 15, 2008
    Location:
    ~/bunny/
    #6
    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)

    :)
     

Share This Page