From fd4c06600895104cbf6bcde921d4857c8c5b2718 Mon Sep 17 00:00:00 2001 From: Michal T Date: Sun, 5 Jan 2025 20:30:05 +0000 Subject: [PATCH] Status report script --- status_report.sh | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 status_report.sh diff --git a/status_report.sh b/status_report.sh new file mode 100755 index 0000000..8c20135 --- /dev/null +++ b/status_report.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +# Script to check and display Raspberry Pi parameters using libgpiod + +echo "=== Raspberry Pi System Information ===" + +# General system information +echo "Hostname: $(hostname)" +echo "Model: $(cat /proc/device-tree/model | tr -d '\0')" +echo "CPU Temperature: $(vcgencmd measure_temp | cut -d '=' -f2)" +echo "CPU Frequency: $(vcgencmd measure_clock arm | awk -F= '{print $2}') Hz" +echo "GPU Frequency: $(vcgencmd measure_clock core | awk -F= '{print $2}') Hz" +echo "Voltage: $(vcgencmd measure_volts | cut -d '=' -f2)" + +# Memory and disk usage +echo "Total Memory: $(free -h | grep Mem | awk '{print $2}')" +echo "Used Memory: $(free -h | grep Mem | awk '{print $3}')" +echo "Free Memory: $(free -h | grep Mem | awk '{print $4}')" +echo "Disk Usage:" +df -h | grep '^/dev/root' + +# Network information +echo "IP Address: $(hostname -I | awk '{print $1}')" +echo "MAC Address: $(cat /sys/class/net/eth0/address 2>/dev/null || echo 'No Ethernet')" + +# Uptime +echo "Uptime: $(uptime -p)" +echo "Last Boot: $(who -b | awk '{print $3, $4}')" + +# GPIO Information using libgpiod +echo "GPIO Chip Info:" +if command -v gpioinfo &>/dev/null; then + gpioinfo +else + echo "gpiod tools not installed. Please install libgpiod using 'sudo apt install gpiod'." +fi + +echo "=== End of Raspberry Pi System Information ==="