|


| NAVIGATION |
|
Home |
|
Store |
|
|
| INSIDE MAC |
|
Television Shows |
|
Broadcast Shows |
|
Daily News Shows |
|
Special Shows |
|
|
| EVENTS |
|
|
|
|
|
|
|
|
| DAILY TIPS |
|
Design |
|
Mac OS X |
|
Mac OS X UNIX |
|
|
| COMMUNITY |
|
Forums |
|
Surveys |
|
|
| NEWS |
|
Current |
|
Press |
|
Archive |
|
|
| FEATURES |
|
Editorial |
|
Dr. Mac |
|
Reviews |
|
Reader Reports |
|
|
| RESOURCES |
|
FAQ |
|
Documentation |
|
Learning Center |
|
MAN pages |
|
Glossary |
|
Tutorials |
|
Tips |
|
Links |
|
|
|

|
|
|
Reader Reports 
Reconfiguring Network Services
This UNIX shell script that will restart the various networking daemons without a full-blown system reboot, allowing the user to reconfigure network settings without restarting OS X.
To make use of this script, make sure you are logged into OS X as Administrator/root. Open the Terminal application, and type "pico net-restart.sh" (without the quotes, of course). This will open Pico, a command-line text editor. Then, copy the script below and paste it into the terminal. Now hit Ctrl-X to exit Pico, and when prompted to "Save modified buffer?", hit return twice to save the file to disk.
You will now be back at the UNIX command line; type "chmod 555 net-restart.sh" to set the file's permissions to allow it to be executed as a script.
Now make any changes you'd like to the Network control panel, and head back to the Terminal. Type "./net-restart.sh", and the script should run without incident:
# !/bin/sh
#
# This UNIX shell script that will restart the various networking daemons
# without a full-blown system reboot, allowing the user to reconfigure network
# settings without restarting OS X.
#
# Timothy Hatcher
# Licensed under OPL case `whoami` in
root) ;; *) echo "Not Administrator (root). You need to be in order to
restart the network." return ;; esac echo "Restarting the network,
network will be unavailable." kill `ps aux | grep ipconfigd | grep -v
grep | awk '{print $2}'` echo " - Killed 'ipconfigd'." ipconfigd
echo " - Started 'ipconfigd' right back up." sleep 1 ipconfig
waitall echo " - Ran 'ipconfig waitall' to re-configure for new
settings." sleep 1 kill -HUP `cat /var/run/nibindd.pid` echo " -
Killed 'nibindd' with a HUP (hang up)." sleep 2 kill -HUP `cat
/var/run/lookupd.pid` echo " - Killed 'lookupd' with a HUP (hang
up)." echo "The network has successfully been restarted and/or
re-configured and is now available."
Tai Kahn
ed. note -- as with any remote network administration, be careful; one mistake and you'll be driving to the office!
|





|
 |
|
 |
Copyright © 2000-2008 Inside Mac Media, Inc. All rights reserved. |
Apple assumes no responsibility with regard to the selection, performance, or use of the products or services. All understandings, agreements, or warranties, if any, take place directly between the vendors and prospective users. |
| Apple, the Apple logo, Mac, PowerMac G4, PowerMac G5, Xserve, Xserve RAID, PowerBook, iBook, Airport, AirPort Extreme, iMac, eMac, iLife, iMovie, iCal, iPhoto, iTunes, QuickTime, FireWire, iPod, iSight, AppleWorks, Macintosh, Jaguar, Panther, Mac OS, Mac OS X and Mac OS X Server are trademarks of Apple Computer, Inc. |
|