get XO id via bash

Mikus Grinbergs mikus at bga.com
Fri Feb 25 14:39:39 EST 2011


> how to get the XO unique identifier using bash?

Please be more explicit in what you mean by "identifier".


To get the serial number:

  >   if [ -e /ofw/serial-number ]; then
  >     echo "Serial    : "`cat /ofw/serial-number`
  >   fi

To get the radio MAC address:

  Get output of 'ifconfig eth0', then extract the string
  after the label "HWaddr"

To get the name given to Sugar:

  Get output of 'gconftool-2 --direct
    --config-source=xml:readwrite:/home/olpc/.gconf
    /desktop/sugar/user/nick --get'

    [That command is all on one line]

To get the name given to NetworkManager:

  Get output of 'hostname' (and parse if need be)


mikus




More information about the Devel mailing list