Skip to content

Instantly share code, notes, and snippets.

@mjeveritt
Last active December 28, 2019 21:05
Show Gist options
  • Save mjeveritt/630c0792fe4a1ef7f1f6a5f351629b75 to your computer and use it in GitHub Desktop.
Save mjeveritt/630c0792fe4a1ef7f1f6a5f351629b75 to your computer and use it in GitHub Desktop.
Updated Pi identification function
# 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"
@mjeveritt
Copy link
Author

Requires figlet & iw tools as dependencies.
Gentoo: app-misc/figlet and net-wireless/iw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment