• Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    boot_wb
    Posts: 874 from 2007/4/9
    From: Kingston upon ...
    Quote:

    jPV wrote:
    Quote:

    Ginger1 wrote:
    I have also tried adding a line to user-startup:

    Code:
    Execute sys:applications/polyorga/orga

    But this doesn't work either. A quick look in an old AmigaDOS book suggests this is just for launching scripts. Run doesn't look quite either.



    If you want to launch workbench programs from any kinds of scripts, use the WBRun command. It changes directory to the executable's location (and thus finds its data files) and runs the program like double clicked from an icon (it reads tooltypes from the icon etc).


    Quote:

    boot_wb wrote:

    One notable exception is where an application requires the network to be active before starting. In this case it may be best to use a script that waits for the network before launching the application, such as:

    Waitforport netstat
    Run >NIL: path:to/your/executable



    You probably meant "waitforport NETSTACK" (typo & case-sensitive)


    I did, (corrected above), thanks for the correction.

    Quote:

    But I've noticed that at the time when NETSTACK port appears, network isn't properly set yet (IP addresses might not be assigned etc), so I've been using this instead:
    WaitForPort inetd.ipc LOOP=30

    inetd.ipc is the last port appearing when starting up the TCP/IP stack and network is pretty much up on all aspects at that point. Loop is there to ensure that it'll wait for the network even if there is some delay (likely with wireless networks).



    Good advice, thanks.

    NB - Doesn't WaitForPort loop indefinitely (with a default 1 second interval) if LOOP is not specified?
    If so, then the command above makes the script self-terminating after 30 loops, rather than extending its life to wait as long as needed. I admire 'self-terminating' as a principle in looping scripts :), but is this what was intended?
    www.hullchimneyservices.co.uk

    UI: Powerbook 5,6 (1.67GHz, 128MB VRam): OS3.1, OSX 10.5.8
    HTPC: Mac Mini G4 (1,5GHz, 64MB VRam): OS3.1 (ZVNC)
    Audiophile: Efika 5200b (SB Audigy): OS3.1 (VNC + Virtual Monitor)

    Windows free since 2011!
  • »11.10.16 - 22:46
    Profile Visit Website