I can check for the arm hardware with:
Code: Select all
#! /bin/bash WHAT_AM_I=$(uname -m) echo "$WHAT_AM_I"
Is that good enough to reliably determine we are running on a Pi?
I would also like to get more adventurous, and make my script work for different OSes on the Pi too - it is currently aimed at Raspbian, but if I can detect a different OS, then I can run routines specific to that OS (i.e. using pacman or yum instead of apt).
How can I reliably determine the OS breed. Preferably with a routine that will survive OS version number updates...
e.g. I'd like to create a variable who's contents are "Arch" or "Fedora" or "Raspbian" etc.