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


Click here to return to the 'Disable AirPort when Ethernet cable is connected' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Disable AirPort when Ethernet cable is connected
Authored by: Coumerelli on Mar 09, '10 07:41:47AM

This is great! I've run into the same need for myself. But when the Ethernet is then unplugged, will it release the airport and then also turn it back on? Doesn't look like it from the script.

---
"The best way to accelerate a PC is 9.8 m/s2"



[ Reply to This | # ]
Disable AirPort when Ethernet cable is connected
Authored by: kainewynd2 on Mar 09, '10 02:41:31PM

NOTE: This command requires the device name, not just the command, so you'll have to add that in as in the examples below.

You could throw a "/usr/sbin/networksetup -setairportpower Airport on" after the else statement like so:

#!/bin/sh
if ifconfig en0 | grep 155.144; 
then /usr/sbin/networksetup -setairportpower Airport off
else
/usr/sbin/networksetup -setairportpower Airport on
fi

Attempting to "Turn On" an already running airport does not result in any change to connectivity in quick testing at home.



[ Reply to This | # ]
Disable AirPort when Ethernet cable is connected
Authored by: ardong on Jul 19, '10 12:31:54PM
I made a small amendment to this script:

#!/bin/sh
if ifconfig en0 | grep inet; 
then /usr/sbin/networksetup -setairportpower Airport off
else
/usr/sbin/networksetup -setairportpower Airport on
fi


[ Reply to This | # ]