Created
May 8, 2019 19:06
-
-
Save evaneliasyoung/3c5776b47e1af630a311945349748372 to your computer and use it in GitHub Desktop.
Identifies which Raspberry Pi model you have
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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