Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Auto-disable AirPort when ethernet is active' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Auto-disable AirPort when ethernet is active
Authored by: brettmjohnson on Oct 06, '10 05:23:47PM
It should be noted that this script works only on Snow Leopard (Mac OS 10.6) not Leopard (Mac OS 10.5).

The calling parameters to networksetup w.r.t. testing and setting airport power changed.
In 10.6, you specify the network device (en1), whereas in 10.5, you do not.

Also the generated output from /usr/sbin/networksetup -getairportpower changed, so the awk command needs to modified.
Basically, the changes to run on 10.5 are as follows:

In function set_airport, drop the device name from setairportpower:

 /usr/sbin/networksetup -setairportpower  on  (or off)
And also when getting the actual current Aiport status:
air_status=`/usr/sbin/networksetup -getairportpower | awk '{ print $3 }'`
Finally a test needs to change to be valid test syntax
# Update ethernet status
if [ "$eth_status" == "On" ]; then
should be fixed as:
# Update ethernet status
if [ "$eth_status" = "On" ]; then

[ Reply to This | # ]