GL-X3000 - How to get serial number and device id via ssh

How do I get the serial number and device id on a GL-X300 router after establishing an ssh connection to the router?

Try this:

If not the case, login by SSH and run (according to this official reply):

curl -k -H 'glinet: 1' -d '{"jsonrpc":"2.0","method":"call","params":["","system","get_info",{}],"id":1}'

Serial: uci get ddns.glddns.password
Device ID: uci get ddns.glddns.param_enc

Should work mostly.

If you just want to check them (so no need to getting them straight as some variable for example) you can read the factory partition instead:

FACTORY_PARTITION=$(blkid -t PARTLABEL="factory" -o device)
# Device ID
hexdump -n 8 -s 16 -C $FACTORY_PARTITION
# Serial
hexdump -n 16 -s 48 -C $FACTORY_PARTITION

Thanks for your reply @maholio and @admon. I found the serial number and device id under the /poc/gl-hw-info/ directory. Both of these are stored in a file.

cat /poc/gl-hw-info/device_sn to get the serial number
cat /poc/gl-hw-info/device_ddns to get the device id