Skip to content

Instantly share code, notes, and snippets.

@evaneliasyoung
Created May 8, 2019 19:06
Show Gist options
  • Save evaneliasyoung/3c5776b47e1af630a311945349748372 to your computer and use it in GitHub Desktop.
Save evaneliasyoung/3c5776b47e1af630a311945349748372 to your computer and use it in GitHub Desktop.
Identifies which Raspberry Pi model you have
#!/bin/sh
REV=$(cat /proc/cpuinfo | grep Revision | sed 's|.*: ||')
case $REV in
000[7-9])
DEF="A"
;;
0012|0015)
DEF="A+"
;;
000[2-3])
DEF="B Rev. 1"
;;
000[4-6]|000[d-f])
DEF="B Rev. 2"
;;
0010|0013|900032)
DEF="B+"
;;
a[0-2]1041)
DEF="2 v1.1"
;;
a22042)
DEF="2 v1.2"
;;
a[0-2]2082)
DEF="3"
;;
900092)
DEF="Zero v1.2"
;;
900093)
DEF="Zero v1.3"
;;
0x900C1)
DEF="Zero W"
;;
0011|0014)
DEF="Compute"
;;
*)
DEF="NIL"
;;
esac
echo "You have a Raspberry Pi $DEF"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment