#!/bin/bash #interfaces: #ifconfig -a | sed 's/[ \t].*//;/^$/d' | grep -v "lo" | tr -d ":" #ip for interface: #ip address show dev vcn scope global | awk '/inet / {split($2,var,"/"); print var[1]}' spacer=" " while true; do freq_raw=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq) temp=$(vcgencmd measure_temp) volt=$(vcgencmd measure_volts) freq=$(( $freq_raw / 1000 )) echo "System stats:" echo " "$(uptime) echo " ---" echo "Raspi stats:" echo " freq="$freq"mhz" echo " "$temp echo " "$volt echo " ---" echo "Net stats:" for interface in $(ifconfig -a | sed 's/[ \t].*//;/^$/d' | grep -v "lo" | tr -d ":") do echo " "$interface": "$(ip address show dev $interface scope global | awk '/inet / {split($2,var,"/"); print var[1]}') done echo " ---" sleep 5 clear # # \r is a "carriage return" - returns cursor to start of line # printf "\r%3d Days, %02d:%02d:%02d" $DAYS $HOURS $MINS $SECS # In the following line -t for timeout, -N for just 1 character read -t 0.25 -N 1 input if [[ $input = "q" ]] || [[ $input = "Q" ]]; then # The following line is for the prompt to appear on a new line. echo break fi done