From 570b35fa02be0c9f05df6170d4a0ab5201ab3bba Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Tue, 16 Oct 2018 10:33:22 -0400 Subject: [PATCH] Tweaking thinkfan-confgen a bit --- thinkfan-confgen | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/thinkfan-confgen b/thinkfan-confgen index 66ebdcb..bf6b0a4 100755 --- a/thinkfan-confgen +++ b/thinkfan-confgen @@ -1,7 +1,14 @@ #!/usr/bin/env bash set -o errexit +set -o pipefail main() { + if [[ -f "${1}" ]]; then + exec 1>"${1}" + fi + + printf "# thinkfan-confgen created %s\n" "$(date -u)" + find /sys -type f -name 'temp*_input' | while read -r line; do echo "hwmon ${line}" done