mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-09-20 04:37:19 +02:00
add hardware info tool
This commit is contained in:
32
home.admin/config.scripts/blitz.hardware.sh
Normal file
32
home.admin/config.scripts/blitz.hardware.sh
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
#!/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)
|
||||||
|
|
||||||
|
|
||||||
|
########################
|
||||||
|
# OUTPUT HARDWARE INFO
|
||||||
|
#######################
|
||||||
|
|
||||||
|
if [ "$1" = "status" ]; then
|
||||||
|
echo "board='${board}'"
|
||||||
|
echo "ramMB=${ramMB}"
|
||||||
|
fi
|
Reference in New Issue
Block a user