#!/bin/bash # SARPi Project - Slackware ARM on a Raspberry Pi [sarpi.penthux.net] # # Copyright (c) 2021 Sarpi Project - https://sarpi.penthux.net # # cpu_status.sh # # Raspberry Pi CPU clock frequency and thermal status. # This script outputs the current status of the CPU clock speed (MHz) # and core temperature (Celsius) for monitoring or testing purposes # while under load or idle. Easily modified to suit other ARM devices. # # Usage - # Default command: ./cpu_status.sh # run once, no refresh # Default refresh: watch ./cpu_status.sh # 2 seconds refresh # Custom refresh: watch -n ./cpu_status.sh # With highlights: watch -d -n0 ./cpu_status.sh # Perm highlights: watch -d=cumulative -n0 ./cpu_status.sh # # Exaga : 15 Jan 2018 - progenitor # 29 Jun 2019 - update rpi model & hw revision # 03 Jul 2019 - update quad-core cpu and system uptime # 18 Jul 2019 - update cpu-id and cpufreq-info # 27 Jan 2020 - code revision and update # 07 Sep 2020 - code clean-up # Halt script process on error set -e IFS="$(printf '\n\t')" # Output SARPi marque echo -e "SARPi Project - sarpi.penthux.net\nSlackware ARM SoC [MHz & Thermal] Stats\n" # Get RPi model, hardware revision, and CPU RPiModel=$(tr -d '\0'