Last active
December 28, 2019 21:05
-
-
Save mjeveritt/630c0792fe4a1ef7f1f6a5f351629b75 to your computer and use it in GitHub Desktop.
Updated Pi identification function
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
# Text to clearly identify server | |
echo -e "\033[1;34m" | |
boardRev=`grep Revision /proc/cpuinfo | awk '{ print $3; }'` | |
#if [ "${boardRev}" == "9000c1" ] | |
case "${boardRev}" in | |
#then | |
000d) | |
figlet -f slant "Pi - Model B Rev 2" | |
echo " Raspberry Pi -tastic" | |
;; | |
0010|0013|900032) | |
figlet -f slant "Pi - Model B+" | |
echo " Raspberry Pi -tastic" | |
;; | |
900092|900093) | |
figlet -f slant "Pi - ZERO" | |
echo " The first computer ever to be given away on the front of a magazine!" | |
;; | |
9000c1) | |
figlet -f slant "Pi - ZERO-W" | |
nearbyNetworks=`sudo iwlist wlan0 scan | grep ESSID | wc -l` | |
echo " There are $nearbyNetworks networks nearby" | |
;; | |
#else | |
*) | |
figlet -f slant "Unknown Pi" | |
echo " Board id: ${boardRev}" | |
;; | |
#fi | |
esac | |
echo -e "\033[0m" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Requires figlet & iw tools as dependencies.
Gentoo: app-misc/figlet and net-wireless/iw