fancontrol: Uplift the --check option

- do not duplicate the load code
 - add description to man page
This commit is contained in:
Michal Suchanek authored and Michal Suchánek committed 2024-02-17 12:41:20 +01:00
1 parent c2df8a4183
commit 2d18c0952a
2 files changed
+17 -9

No files matched your search

+7 -7
View File
@@ -390,15 +390,11 @@ function CheckFiles
return $outdated
}
CHECK_ONLY=false
if [ "$1" == "--check" ]
then
if [ -f "$2" ]
then
LoadConfig $2
else
LoadConfig /etc/fancontrol
fi
exit 0
CHECK_ONLY=true
shift
fi
if [ -f "$1" ]
@@ -408,6 +404,10 @@ else
LoadConfig /etc/fancontrol
fi
if $CHECK_ONLY ; then
exit 0
fi
# Detect path to sensors
if echo "${AFCPWM[0]}" | grep -E -q '^/'
then
+10 -2
View File
@@ -3,14 +3,22 @@
fancontrol \- automated software based fan speed regulation
.SH SYNOPSIS
.B fancontrol
.I [configfile]
.B fancontrol [
.I --check
.B ] [
.I configfile
.B ]
.SH DESCRIPTION
\fBfancontrol\fP is a shell script for use with lm_sensors. It reads its
configuration from a file, then calculates fan speeds from temperatures and
sets the corresponding PWM outputs to the computed values.
.SH OPTIONS
.IP "--check"
Check configuration file end exit. This option can be used for verifying the
configuration before starting fancontrol as a service in the background.
.SH WARNING
Please be careful when using the fan control features of your mainboard, in
addition to the risk of burning your CPU, at higher temperatures there will be