Solved

Bash:  Mac OS X 10.6.8/SL:  How does Network Diagnostics fix?

Posted on 2011-10-01
4
989 Views
Last Modified: 2012-05-12
I have a very easy bash Macintosh network question for you.

I'm currently in a situation where I have to unplug and replug in a Mac's ethernet cable.  (Because of some network configuration which is unrelated to this question.)

When I plug the ethernet back into the Mac, I've found that the fastest way to get the OS to respond to the new network connection is to go to:

Preferences > Network > Ethernet (n) > Assist Me > Diagnostics > Ethernet > Continue.

In which case, a dialog responds that the internet connection appears to be operating.  (And now it is.)

My question is, this is doing this very quickly and surely there must be some bash script I can write that can duplicate this simple procedure.

I can't simply do a
$ sudo ifconfig en0 up

(Macs use en0 instead of enth0 or something.)

What am I missing?  This should be a very simple thing to do.

0
Comment
Question by:coder1313514512456
  • 3
4 Comments
 
LVL 9

Accepted Solution

by:
Shaun McNicholas earned 250 total points
ID: 36896275
try opening a terminal window and type the commands:

sudo ifconfig en0 down
sudo ifconfig en0 up

if you aren't sure what the interface is called on your system just type
ifconfig

that should display the current network interfaces available on your system.
This should help - http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man8/ifconfig.8.html
0
 

Author Comment

by:coder1313514512456
ID: 36896629
I'll try having it go down before going up on the next iteration.  Thanks maestropsm.

0
 

Author Comment

by:coder1313514512456
ID: 36896706
Early indications are that it seems to work like a champ.

Thanks again, don't know why I didn't think of bringing it down first.

0
 

Author Closing Comment

by:coder1313514512456
ID: 36896709
Bring the interface down before you bring it up.  Right.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

In certain circumstances, a Microsoft Office mac application may fail to save a document to a network server, with the following error message: "There has been a network or file permission error. The network connection may be lost." An article at…
The error "There was an error performing the update" occurred on a Mac OS X client workstation running  Symantec AntiVirus for Mac (http://www.symantec.com/business/products/purchasing.jsp?pcid=pcat_security&pvid=825_1) - the Enterprise product vers…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now