shell command to identify wireless printer

Mike Bonner bonnmike at gmail.com
Tue Oct 12 10:17:47 EDT 2010


Ignore any duplicates that show up, forgot to clean up last message and its
being held for moderator approval, so don't know if they'll magically appear
or not. This email is easier to read anyway. I'm actually awake now!

Try this:
   get shell("cd /usr/sbin;system_profiler SPNetworkDataType |grep -i
signature")
   set the itemdel to "="
   put the last item of it into yourplacetostoreit

It grabs the hardware signature of the router and splits out the last item
which is the routers mac address. Should be a more reliable method of
tagging what network you're on. SSID may not be unique since so many people
never change the default.

This should work for wired or wireless.

I don't know how likely it is you'll have more than one valid connection at
a time, if its a possibility for you, might consider testing it to see if it
contains more than one line.

Also running virtual machines could throw this off I guess, but it shouldn't
be too bad to get a handle on things.

If nothing else, don't split off the mac address and use the entire result
as your matching text.  If there IS more than 1 valid result, and you do use
the entire thing as your match text, also might consider a sort since I
can't test if system_profiler always lists in the exact same order.



More information about the use-livecode mailing list