3 Replies Latest reply: Aug 1, 2012 4:37 PM by Art.Peck RSS

    Determine Sun Ray DTU model in a shell script

    Art.Peck
      I have a need to identify the Sun Ray DTU model in a shell script. In particular, I need to distinquish a Sun Ray DTU from an OVDC instance. I'm collecting location information from the user and I don't care about OVDC so I want to not as the question in that case.
        • 1. Re: Determine Sun Ray DTU model in a shell script
          929328
          Hi
          You can try utdesktop -Lc or -Lg, and if any come up with a MAC address
          starting with 00144f, then it's very very likely to be a Sun Ray 2/2FS/270.
          It's possible other units will register as that, but we haven't seen any
          here. Not a surefire way to say, but it might be good enough.

          Even better, you can do a

          /opt/SUNWut/sbin/utfwload -Ha

          on each of your SRSS and see a similar output like:

          DISP User IP Address Model.Mac Firmware Version
          11.0 ???? x.x.x.x P8-FS.00144fa80ef3 GUI4.2_77_2009.10.19.17.01
          11.1 ???? x.x.x.x P8.00144f0e9d75 GUI4.2_77_2009.10.19.17.01
          12.0 ???? x.x.x.x P8.00144f0e9d73 GUI4.2_77_2009.10.19.17.01
          13.0 ???? x.x.x.x P7.0003ba8bb0c4 GUI4.2_77_2009.10.19.17.01

          As you can see you will see a "P8-FS" and "P8" in the "Model.Mac" number
          output. "P8-FS" does of course point at the 2FS models while the simple
          "P8" standards for a normal SunRay2 station.
          If you have questions ask me.
          Kirill Babeyev
          • 2. Re: Determine Sun Ray DTU model in a shell script
            Art.Peck
            OK. I think I answered my own question.

            /tmp/SUNWut/config/dispinfo/my_display_number has a line:

            MODEL_ID=SunRayP9-E

            for my Sun Ray 3 Plus.

            Need to verify the other values, but this looks like a good trade-off of interrupting authd at a busy time and using a non-supported data structure.

            Thoughts?

            Art
            • 3. Re: Determine Sun Ray DTU model in a shell script
              Art.Peck
              For anyone interested, here's the code I will use unless there is a better suggestion:

              #!/usr/bin/bash

              myDISP=$(echo ${DISPLAY} | sed 's/.*:\([^.]*\).*/\1/')

              eval $(sed -n 'MODEL_ID/p' /tmp/SUNWut/config/dispinfo/${myDISP})

              case ${MODEL_ID} in

              SunRayS1) ;; # do nothing

              *) echo "do something" ;;

              esac