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

10.4: An AppleScript to help maintain AirPort connections Network
Every so often, the AirPort connection on my Intel Mac mini would drop off for no apparent reason. Searching on the web reveals that I am not alone. This problem seems to affect the Intel Mac mini, MacBook, and MacBook Pro. While I am optimistic Apple will fix this problem eventually, I couldn't wait. So I wrote an AppleScript to test the network periodically and restart it when necessary.

You can read about (and download (4KB)) the script from my blog.

[robg adds: I haven't noticed this issue on my Intel Macs, but I have read of others having the issue. I have mirrored the script (but not the runnable version linked on the blog) on macosxhints, in case the first becomes unavailable.]
  • Currently 1.67 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (3 votes cast)

10.4: An AppleScript to help maintain AirPort connections | 3 comments | Create New Account
Click here to return to the '10.4: An AppleScript to help maintain AirPort connections' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Enable GUI Scripting first
Authored by: jcteo on Jun 29, '06 04:41:31PM

I'm the person who submitted this hint. I neglected to mention on my blog that for the script to work, GUI Scripting has to be enabled. To do so, open AppleScript Utility (in /Applications/AppleScript) and select the "Enable GUI Scripting" checkbox.

[ Reply to This | # ]
10.4: An AppleScript to help maintain AirPort connections
Authored by: v_temp on Jun 29, '06 10:17:48PM

I noticed the problem of wireless network drops with my MacBook Pro. After some investigation I found that the issue was not with the MacBook Pro, but with the channel I was using on my wireless router. Using a program like KisMAC I was able to scan for all other wireless APs within range of my wireless AP and saw that I was using a channel that many others were using. Certainly this causes interference, so I switched to a channel that none or very few are using. The problem ceased. Using the "Interference Robustness" option can help in these situations to a certain degree by sacrificing throughput for error correction. However, these days the population of wireless APs is quite dense and interference is a growing problem. Also one should research that channels do not overlap frequencies with each other or other devices. Some wireless router channels do overlap frequencies to different degrees even-though the "channel numbers" are different.

[ Reply to This | # ]
10.4: An AppleScript to help maintain AirPort connections
Authored by: charlesa on Jul 24, '06 01:30:17PM

It seems to me that there ought to be a way to do this entirely within a shell script (and by that I mean not using an osascript call).

Hmmm, Searching.....

Here's an ifconfig-based hint: Enable and disable Airport from the command line.

So, perhaps (untested)


EXIT_CODE=`ping -c 1 -t 4 > /dev/null; echo $?`

if [ $EXIT_CODE -ne 0 ]
  ifconfig en1 down
  sleep 5
  ifconfig en 1 up
Save as a shell script and run periodically by a root cron job (er, launchd task). Actually, it may be worthwhile to base the test on something like ifconfig en1 | grep inet instead of ping(8).

[ Reply to This | # ]