transmote speaks…

design + art + code
  • portfolio
  • rss
  • Home
  • About
  • FLARManager: Augmented Reality in Flash
    • FLARManager intro
    • FLARManager documentation
    • FLARManager – donate
    • Inside FLARManager
      • Inside FLARManager: Getting Started
      • Inside FLARManager: 2D Marker Tracking
      • Inside FLARManager: Basic Augmented Reality
      • Inside FLARManager: Loading Collada Models
      • Inside FLARManager: Tracking Engines
      • Inside FLARManager: Customization
      • Inside FLARManager: FLARManager Miscellany
  • Contact

mounting a server on a wireless network

ericsoco | 2010/07/16 | 4:24 pm

spent a number of hours getting this to work, and as such i thought i’d share it with you, dear readers.

most of you probably have no use for this, but for the slice of you involved in installation work or IT with apple computers, this applescript may come in handy.

placed in your Login Items, this script will do the following on login:

  • attempt repeatedly to join a wireless network, whether hidden or visible
  • ping a server on that network until the server responds, and then
  • mount a volume on that server.

hope someone out there finds the script, or parts of it, useful.

-- -----join wireless network-----
set networkResult to false
repeat while not networkResult
    try
        
        do shell script "networksetup -setairportnetwork networkName networkPassword | /bin/bash"
        
        -- network found and joined.
        set networkResult to true
        
    on error errorMsg
        
        -- network not yet available;
        -- wait five seconds and try again.
        set networkResult to false
        delay 5
        
    end try
end repeat

-- -----mount server-----
set serverIP to "10.0.1.1"
set serverUsername to "username"
set serverPassword to "password"
set pingResult to "100% packet loss"
set serverFound to false

repeat while not serverFound
    try
        set pingResult to (do shell script ("ping -c 1 " & serverIP))
    on error e
        set pingResult to e
    end try
    
    if pingResult contains "100% packet loss" then
        -- server not found; delay and then try again
        set serverFound to false
        delay 5
    else
        -- server found; exit loop and mount server
        set serverFound to true
    end if
    
end repeat

-- delay to allow server to finish booting
delay 90
mount volume "afp://" & serverIP as user name serverUsername with password serverPassword

Categories
to do
Comments rss
Comments rss
Trackback
Trackback

« FLARManager for flare/NFT FLARManager v1.0 – Augmented Reality with Flash »

1 Tweet

2 responses

Read on: mounting a server on a wireless network: spent

richafur | 2010/07/16 | 4:31 pm

Read on: mounting a server on a wireless network: spent a number of hours getting this to work, and as such i thou… http://bit.ly/9TyOq3

This comment was originally posted on Twitter

note that if you're on snow leopard, you have to

ericsoco | 2010/07/19 | 7:10 pm

note that if you’re on snow leopard, you have to add the ‘device name’ to the networksetup shell command. for airport, this is most likely ‘en1′, so the line changes to:

do shell script "networksetup -setairportnetwork en1 networkName networkPassword | /bin/bash"

thanks to this site for the help figuring this one out…

Leave a comment

You can use these tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Additional comments powered by BackType

Recent Posts

  • Nest 0.2 – Scenegraph and Event Model for Processing/Java
  • ‘flip’ on the Great Wall
  • FLARManager v1.1 – Augmented Reality in Flash
  • pecha kucha, 2011.01.11
  • Alternativa3D version 7 support, ARToolworks forum

Tags

3d actionscript Add new tag AR as3 augmented reality camera Capabilities clibinit computer vision digital elastic event handler exhibit exploratorium fiducial flar flare flarmanager flartoolkit flash flash player forum garbage collection generative grid interactive Keyboard marker memory mesh mirror natural feature tracking NFT notes papervision presentation reflection slides sputnik to see tracking video video mirror webcam


If FLARManager has helped you out, please help FLARManager!







Serious ADHD Likely!
rss Comments rss design by jide