William Yang wrote:
I've been using
#MAC fetching based on code found here:
http://blogs.sun.com/ThinkThin/category/CAM+(Kiosk)
MYDISP=`echo $DISPLAY | cut -d: -f2 | cut -d. -f1`
MYMAC=`grep TERMINAL /tmp/SUNWut/config/dispinfo/$MYDISP | cut -d.
-f2`
But we all know that Bob doesn't like multiple sed/awk/cut on one line ;)
:)
MYDISP=$(echo $DISPLAY | sed 's/.*:\([^.]*\).*/\1/')
or better yet (invoking zero processes is even better):
MYDISP=${DISPLAY#*:}
MYDISP=${MYDISP%.*}
MYMAC=$(sed -n 's/^TERMINAL_ID=[^.]*\.//p'
/tmp/SUNWut/config/dispinfo/$MYDISP)
:)
-Bob
William Yang
-----Original Message-----
From: [email protected] [mailto:sunray-users-
[email protected]] On Behalf Of John Francis
Sent: Friday, August 13, 2010 10:52 PM
To: SunRay-Users mailing list
Subject: Re: [SunRay-Users] MAC Address
On 14 August 2010 05:13, Brian Imbriani <[email protected]> wrote:
So I've done some googling, and none of these issues really seem to work
very well in CentOS5/SRSS4.2.
I need to get the MAC address of the SunRay so that I can then get the
"Location" of the sunray.
(SideBar: If there's a direct way of getting the "Location" and "Other"
fields of the sun-ray, I'm all ears).
Someone wrote this for me once:
--------------
SRMAC=`cd $theFlag $UTDEVROOT; pwd | sed 's/.*\(............\)/\1/'`
You want "cd -P" if you're using Bash on CentOS.
THELOC=`/opt/SUNWut/sbin/utdesktop -l |grep $SRMAC | /usr/bin/awk
'{print
$2;}'`
--------------
I do:
SRMAC=`cd -P $UTDEVROOT; pwd | sed 's/.*\(............\)/\1/'`
in Bash and that seems to work fine.
--
Kind regards,
John Francis
_______________________________________________
SunRay-Users mailing list
[email protected]
http://www.filibeto.org/mailman/listinfo/sunray-users
_______________________________________________
SunRay-Users mailing list
[email protected]
http://www.filibeto.org/mailman/listinfo/sunray-users
_______________________________________________
SunRay-Users mailing list
[email protected]
http://www.filibeto.org/mailman/listinfo/sunray-users