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

Comments
2 Comments »
Categories
to do


Comments rss Comments rss
Trackback Trackback

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