Skip to content

Instantly share code, notes, and snippets.

@joemaller
Last active August 29, 2015 14:15
Show Gist options
  • Select an option

  • Save joemaller/e0eebe722a559a488619 to your computer and use it in GitHub Desktop.

Select an option

Save joemaller/e0eebe722a559a488619 to your computer and use it in GitHub Desktop.
Kickstart wifi connection on old Mac

My webcam is running on an old MacBook that seems to have a spotty connection to the internet. When this computer drops the wifi connection, it doesn't ever seem to reconnect. The networksetup command can be used to reconnect, so I'm calling this every 5 minutes from cron to force the connection.

The command was also added to /etc/sudoers so we can call the command with sudo without a password.

*/10 * * * * sudo /usr/sbin/networksetup -setairportnetwork en1 networkName password
username ALL=(ALL) NOPASSWD: /usr/sbin/networksetup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment