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


Click here to return to the 'How to change your IP' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
How to change your IP
Authored by: fabiolecca on Sep 22, '01 08:44:23AM

Hello!

I just discovered a VERY useful terminal command: with scselect you can switch your location settings just as if you were selecting the "Location" menu command from the GUI. It can be very useful from a remote connection and is much more faster than ifconfig.

Fabio



[ Reply to This | # ]
How to change your IP
Authored by: victory on Sep 22, '01 08:07:12PM

What an incredibly useful command!
While usage is self-explanatory, it doesn't appear to have a man page nor any built-in documentation. It seems to be part of Darwin (not OSX-specific) so I managed to find and browse through the source for this command, which is very short. The conclusion is that it does what it does. No other hidden options, etc. Apparently it stands for [S]ystem [C]onfiguration select.

Thanks again. Maybe you should consider submitting this as a formal 'trick' so more readers will see it.



[ Reply to This | # ]
How to change your IP
Authored by: chabig on Dec 15, '02 09:07:03AM

Scselect has no man page, but if you type "scselect -h" it will display its usage.

Chris



[ Reply to This | # ]
How to change your IP
Authored by: mblakele on Apr 24, '03 12:11:41PM

Here's a related command: scutil

Reminiscent of niutil, scutil is an interactive console for configd settings. Fire it up and type 'help' for some online help (cryptic, unfortunately).

Here's how to pull the current location from scutil. This one-liner appeared in a UseNet posting by Stefan Haller:

scutil <<- EOT | awk 'BEGIN { FS = " : "} /UserDefinedName/ { print $2 } END { }'
   open
   show Setup:/
   close
   quit
EOT


[ Reply to This | # ]
How to change your IP
Authored by: mblakele on Apr 25, '03 09:11:17PM

I just noticed that scselect messes up the permissions on the /private/var/db/SystemConfiguration/preferences.xml file, which causes all the Locations to disappear from the Apple menu and the Networks PreferencePane.

The fix? Any time you run scselect, remember to chmod the file.

552$ ls -l /private/var/db/SystemConfiguration/preferences.xml 
-rw-r--r--   1 root     wheel      100198 Apr 25 18:01 /private/var/db/SystemConfiguration/preferences.xml
553$ scselect "Home"
CurrentSet updated to 1 (Home)
554$ ls -l /private/var/db/SystemConfiguration/preferences.xml 
-rw-------   1 root     wheel      100198 Apr 25 18:09 /private/var/db/SystemConfiguration/preferences.xml
555$ sudo chmod 644 /var/db/SystemConfiguration/preferences.xml
556$ ls -l /private/var/db/SystemConfiguration/preferences.xml 
-rw-r--r--   1 root     wheel      100198 Apr 25 18:09 /private/var/db/SystemConfiguration/preferences.xml


[ Reply to This | # ]