mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-10-31 13:10:30 +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
@@ -11,6 +11,7 @@ SVN HEAD
|
||||
Add detection of F71868A
|
||||
Add a PCI ID for new family 15h AMD processors
|
||||
Introduce automatic mode (--auto)
|
||||
Detect incorrect non-interactive runs
|
||||
|
||||
3.3.4 (2013-05-27)
|
||||
sensors.conf.5: Mention "sensors -u" to get the raw feature names
|
||||
|
||||
@@ -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