From 45446011ec5c5322fa29bd4f24148847ef6053c5 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sat, 28 Feb 2009 19:38:22 +0000 Subject: [PATCH] Exit if configuration file can't be read. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5667 7894878c-1315-0410-8ee3-d5d059ff63e0 --- CHANGES | 1 + prog/pwm/fancontrol | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGES b/CHANGES index f2c3298c..83724a8e 100644 --- a/CHANGES +++ b/CHANGES @@ -24,6 +24,7 @@ SVN-HEAD pwmconfig: Drop support for kernels 2.4 and earlier fancontrol: Don't round temperature values Drop support for kernels 2.4 and earlier + Exit if configuration file can't be read maxilife scripts: Delete (driver never ported to Linux 2.6) sensord: Accept negative temperatures in RRD database Don't bail out on transient errors (#2330) diff --git a/prog/pwm/fancontrol b/prog/pwm/fancontrol index f52da908..b49e1ba5 100755 --- a/prog/pwm/fancontrol +++ b/prog/pwm/fancontrol @@ -54,6 +54,12 @@ declare -i pwmval function LoadConfig { echo "Loading configuration from $1 ..." + if [ ! -r "$1" ] + then + echo "Error: Can't read configuration file" + exit 1 + fi + # grep configuration from file INTERVAL=`egrep '^INTERVAL=.*$' $1 | sed -e 's/INTERVAL=//g'` FCTEMPS=`egrep '^FCTEMPS=.*$' $1 | sed -e 's/FCTEMPS=//g'`