tags:

views:

183

answers:

1

i dont have a wifi router, so when at home i need to turn my laptop into a wifi source so that both myself and my partner can access the internet.

however during the days i work at a coffee shop and require the use of their wifi.

i'm running snow leopard and i find it stupidly cumbersome to constantly be turning off and on, first internet sharing and then my wifi.

any ideas for a quick n dirty applescript solution?

thanks a bajillion!

Jon

+1  A: 

You can use launchctl to programmatically start or stop the Internet Sharing service.

The following AppleScript will start Internet Sharing:

do shell script "/bin/launchctl load -w /System/Library/LaunchDaemons/com.apple.InternetSharing.plist" with administrator privileges

The following AppleScript will stop Internet Sharing:

do shell script "/bin/launchctl unload -w /System/Library/LaunchDaemons/com.apple.InternetSharing.plist" with administrator privileges
sakra