mirror of
https://github.com/rootzoll/raspiblitz.git
synced 2024-11-20 18:22:01 +01:00
36 lines
794 B
Bash
36 lines
794 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
# command info
|
||
|
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
|
||
|
echo "Hardware Tool Script"
|
||
|
echo "blitz.hardware.sh [status]"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
########################
|
||
|
# GATHER HARDWARE INFO
|
||
|
#######################
|
||
|
|
||
|
# detect known SBCs
|
||
|
board=""
|
||
|
isRaspberryPi4=$(cat /proc/device-tree/model | grep -c "Raspberry Pi 4")
|
||
|
if [ "${isRaspberryPi4}" == "1" ]; then
|
||
|
board="rp4"
|
||
|
fi
|
||
|
|
||
|
# get how many RAM (in MB)
|
||
|
ramMB=$(awk '/MemTotal/ {printf( "%d\n", $2 / 1024 )}' /proc/meminfo)
|
||
|
|
||
|
# get how many RAM (in GB - approx)
|
||
|
ramGB=$(awk '/MemTotal/ {printf( "%d\n", $2 / 950000 )}' /proc/meminfo)
|
||
|
|
||
|
########################
|
||
|
# OUTPUT HARDWARE INFO
|
||
|
#######################
|
||
|
|
||
|
if [ "$1" = "status" ]; then
|
||
|
echo "board='${board}'"
|
||
|
echo "ramMB=${ramMB}"
|
||
|
echo "ramGB=${ramGB}"
|
||
|
fi
|