Skip to content

Instantly share code, notes, and snippets.

@pavgup
Created September 30, 2015 08:17
Show Gist options
  • Save pavgup/4b547cb4f1cd6d6803f1 to your computer and use it in GitHub Desktop.
Save pavgup/4b547cb4f1cd6d6803f1 to your computer and use it in GitHub Desktop.
a simple strategy to get temperature sensor data and fan status from a wrt1900ac router over stdout
#!/bin/sh
while true;
do
cputemp=$(($(cat /sys/class/hwmon/hwmon2/temp1_input)/1000));
ddrtemp=$(($(cat /sys/class/hwmon/hwmon1/temp1_input)/1000));
wifitemp=$(($(cat /sys/class/hwmon/hwmon1/temp2_input)/1000));
date=$(date +"%H:%M:%S");
fan_val=$(cat /sys/devices/pwm_fan/hwmon/hwmon0/pwm1);
echo $date cputemp=$cputemp" "ddrtemp=$ddrtemp" "wifitemp=$wifitemp fanstatus=$fan_val;
sleep 1;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment