MACUSERS-L Archives

September 2009

MACUSERS-L@LISTSERV.JMU.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Wes Davis <[log in to unmask]>
Reply To:
Wes Davis <[log in to unmask]>
Date:
Fri, 25 Sep 2009 12:12:04 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (50 lines)
Wondering if anyone knows any voodoo for managing or at least removing preferred 
wireless networks via command-line or AppleScript in Leopard? The 'networksetup' 
utility in Snow Leopard is more robust than Leopard's, making this sort of thing 
trivial, but I can't find a good method in Leopard. Oh, yeah, and without 
elevating privileges, preferably.

Things I've looked at:
/usr/sbin/networksetup
  - As mentioned above, it's limited on Leopard to getting/setting the AirPort 
card's power state, getting the name of the current network, and joining a 
network provided that it's open or simply needs a password. That doesn't really 
work with WPA Enterprise/8021.x network.

/System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport
  - Will also associate to a network that's only password protected, but can 
disassociate from a network while leaving the card powered up as well.

/usr/sbin/scutil
  - Lets you talk to 'configd' and monkey (indirectly) with what I assume are 
plist files somewhere and I can get to the AirPort settings 
(Setup:/Network/Interface/en1/AirPort) but get a permission denied error when I 
try to write my changes (deleting the PreferredNetworks key).

/Library/Preferences/SystemConfiguration/com.apple.airport.preferences.plist
- Stores information on previously joined ("known") networks but I can't find a 
correlation between that and the current user's preferred networks. Not writable 
as regular user anyway.

UI scripting via AppleScript
  - An obscenely messy way to accomplish what I want to do and annoying since 
it's not enabled by default (assistive devices). Makes me think that the System 
Preferences application runs with slightly-higher privs than the actual user 
(even for things that aren't locked by default) since it can do things like 
change preferred networks and enable/disable UI scripting. Both of these actions 
seem to require escalation/sudo if done via Terminal or AppleScript.

Any input would be appreciated, even to tell me to take this to the Unix User's 
list :)

Wes

-- 
Wesley Davis
Network Engineering
James Madison University
Massanutten Hall Room 157, MSC 5735
Harrisonburg, VA 22807
(540) 568-5403
[log in to unmask]

ATOM RSS1 RSS2