X-Git-Url: https://git.xandkar.net/?p=khatus.git;a=blobdiff_plain;f=x4%2Fbin%2Fkhatus_x4_sensor_temp;fp=x4%2Fbin%2Fkhatus_x4_sensor_temp;h=2ade37c4f16baa89661fc411c7ac64af6ac3a6f6;hp=0000000000000000000000000000000000000000;hb=5bbff27d4c4195e47400c42f5c324632e7f4936a;hpb=753f5ea7a8ab4abac3f0eae09a6311d2484c453b diff --git a/x4/bin/khatus_x4_sensor_temp b/x4/bin/khatus_x4_sensor_temp new file mode 100755 index 0000000..2ade37c --- /dev/null +++ b/x4/bin/khatus_x4_sensor_temp @@ -0,0 +1,32 @@ +#! /bin/sh + +set -e + +bin_dir="$(dirname $(realpath $0))" + +. "$bin_dir/khatus_x4_lib_common_sensor.sh" + +while : +do + case "$1" + in '') + break + ;; -z|--zone) + case "$2" + in '') + printf "Option $1 requires and argument\n" >&2 + exit 1 + ;; *) + thermal_zone="thermal_zone${2}" + shift 2 + esac + ;; *) + shift 1 + esac +done + +sensor() { + echo "$thermal_zone $(( $(cat /sys/class/thermal/${thermal_zone}/temp) / 1000 ))" +} + +run_as_poller