Created
July 2, 2013 20:02
-
-
Save ofalvai/5912612 to your computer and use it in GitHub Desktop.
My little script to check the Raspberry Pi's status over SSH.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
let freq=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq)/1000 | |
temp=$(vcgencmd measure_temp) | |
temp=${temp:5} | |
wifi=$(cat /proc/net/wireless | grep wlan0 | awk {'print $4'} | tr -d .) | |
read one five fifteen rest < /proc/loadavg | |
uptime=$(uptime | awk '{print $3}' | tr -d ,) | |
card=$(df -h | grep -E '^/dev/mmcblk0p2') | |
used=$(echo $card | awk '{print $3}') | |
free=$(echo $card | awk '{print $4}') | |
percent=$(echo $card | awk '{print $5}') | |
echo "CPU.......: $freq MHz" | |
echo "Temp......: $temp" | |
echo "WiFi......: $wifi%" | |
echo "Load......: $one, $five, $fifteen" | |
echo "Uptime....: $uptime" | |
echo "SD card...: $used used ($percent), $free free" | |
if [[ -n $(pgrep xbmc.bin) ]]; then | |
echo -e "XBMC......: \e[00;32mRunning\e[00m" | |
else | |
echo -e "XBMC......: \e[00;31mStopped\e[00m" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sample screenshot: