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


Click here to return to the 'Getting the Current Network Location' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Getting the Current Network Location
Authored by: lx on Jan 20, '03 01:36:30PM

Thanks for writing up your autosmtp configuration Matt. I don't have this particular issue with the SMTP since my ISP allows me to use theirs from anywhere with authentication, but I was looking for a way to get the current network location setting so a few of my applescripts could do the right thing from the right location. If anyone else is interested, here's an applescript handler culled from Matt's Perl script:

on networklocation()
return (do shell script "scutil <<EOF | sed -n 's/.*UserDefinedName : \\(.*$\\)/\\1/p'
open
show Setup:/
close
EOF")
end networklocation

If somebody knows a better way to do this, then please let me know!



[ Reply to This | # ]
Getting the Current Network Location
Authored by: mattw on Jan 20, '03 04:45:23PM
It's not necessarily an easier way (because it still has to be regexp'd to extract the current location), but this also lets you change location from the command line:
bash-2.05a$ scselect 
usage: scselect [-n] new-set-name

Defined sets include: (* == current set)
   0    (Automatic)
 * 1    (...etc)


[ Reply to This | # ]