Files
OpenDRS/RPiSetup/common.sh

37 lines
897 B
Bash

#!/bin/bash
# common.sh
# OpenDRS Online Discrepancy Reporting System
# Copyright (C) 2023 Rod Wright
# SPDX-License-Identifier: GPL-2.0
function getmodel() {
# Determine the model of Raspberry Pi
# Takes no arguments.
echo -n "Raspberry Pi model is: "
rpimodeltxt=$(tr -d '\0' < /proc/device-tree/model)
echo $rpimodeltxt
echo $rpimodeltxt|grep -q "Raspberry Pi 3"
if [ $? -eq 0 ]
then
ismodel3="true"
fi
}
function getarch() {
# Determine the architecture of Raspberry Pi OS
# Takes no arguments.
echo -n "Architecture is: "
arch_32_64=`getconf LONG_BIT`
echo "$arch_32_64 bit"
}
function getosrelease() {
# Determine the Raspberry Pi OS release name
# Takes no arguments
echo -n "OS Release version is: "
os_rel_ver=`grep VERSION_CODENAME /etc/os-release | cut -d "=" -f2`
echo $os_rel_ver
}