mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-12-04 21:58:18 +00:00
sensors-detect: Detect incorrect non-interactive runs
It is better to use option --auto for non-interactive runs of the sensors-detect script than faking an input to get the default answers to all questions.
This commit is contained in:
1 parent
feb19f45c6
commit
5b6f3f26e0
2 files changed
+11
-1
No files matched your search
@@ -2517,7 +2517,7 @@ sub read_answer
|
||||
print "\n";
|
||||
return "";
|
||||
}
|
||||
return <STDIN>;
|
||||
return <STDIN> || "";
|
||||
}
|
||||
|
||||
###################
|
||||
@@ -7012,6 +7012,15 @@ sub main
|
||||
}
|
||||
|
||||
unload_modules();
|
||||
|
||||
# Check if running non-interactively without --auto
|
||||
if (!$opt{auto} && ! -t STDIN) {
|
||||
print "***************************************************************\n".
|
||||
"Warning: the preferred way to run this script non-interactively\n".
|
||||
"is with option --auto. Other methods are discouraged and may\n".
|
||||
"stop working at some point in the future.\n".
|
||||
"***************************************************************\n\n";
|
||||
}
|
||||
}
|
||||
|
||||
sub cleanup_on_int
|
||||
|
||||
Reference in new issue
Block a user