Commit | Line | Data |
---|---|---|
5bbff27d SK |
1 | #! /bin/sh |
2 | ||
3 | set -e | |
4 | ||
5 | bin_dir="$(dirname $(realpath $0))" | |
6 | ||
7 | . "$bin_dir/khatus_x4_lib_common_sensor.sh" | |
8 | ||
9 | while : | |
10 | do | |
11 | case "$1" | |
12 | in '') | |
13 | break | |
14 | ;; -z|--zone) | |
15 | case "$2" | |
16 | in '') | |
17 | printf "Option $1 requires and argument\n" >&2 | |
18 | exit 1 | |
19 | ;; *) | |
20 | thermal_zone="thermal_zone${2}" | |
21 | shift 2 | |
22 | esac | |
23 | ;; *) | |
24 | shift 1 | |
25 | esac | |
26 | done | |
27 | ||
28 | sensor() { | |
29 | echo "$thermal_zone $(( $(cat /sys/class/thermal/${thermal_zone}/temp) / 1000 ))" | |
30 | } | |
31 | ||
32 | run_as_poller |