Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions common-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,10 @@ function assert_hw_rpi() {
}

local detected_model_number
if [[ $model =~ Raspberry\ Pi\ ([0-9]+) ]]; then
detected_model_number=${BASH_REMATCH[1]}
elif [[ $model == *"Raspberry Pi Model"* ]]; then
# A CMn counts as a Pi n; the original CM and Pi 1 carry no number.
if [[ $model =~ Raspberry\ Pi\ (Compute\ Module\ )?([0-9]+) ]]; then
detected_model_number=${BASH_REMATCH[2]}
elif [[ $model =~ Raspberry\ Pi\ (Compute\ Module|Model) ]]; then
detected_model_number=1
else
echo -e "${RED}** NOT RUNNING ON A RECOGNIZED RASPBERRY PI MODEL **${NC}"
Expand Down
Loading