Clean up the code writing the configuration file.

git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5767 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare committed 2009-09-13 11:19:57 +00:00
1 parent 5ee7d14714
commit bff5a8dde0
1 file changed
+7 -1
+7 -1
View File
@@ -682,7 +682,13 @@ function SaveConfig()
tmpfile=`mktemp -t pwmcfg.XXXXXXXXXX` || { echo "$0: Cannot create temporary file" >&2; exit 1; }
trap " [ -f \"$tmpfile\" ] && /bin/rm -f -- \"$tmpfile\"" 0 1 2 3 13 15
echo "# Configuration file generated by pwmconfig, changes will be lost" >$tmpfile
echo -e "INTERVAL=$INTERVAL\nFCTEMPS=$FCTEMPS\nFCFANS=$FCFANS\nMINTEMP=$MINTEMP\nMAXTEMP=$MAXTEMP\nMINSTART=$MINSTART\nMINSTOP=$MINSTOP" >>$tmpfile
echo "INTERVAL=$INTERVAL" >>$tmpfile
echo "FCTEMPS=$FCTEMPS" >>$tmpfile
echo "FCFANS=$FCFANS" >>$tmpfile
echo "MINTEMP=$MINTEMP" >>$tmpfile
echo "MAXTEMP=$MAXTEMP" >>$tmpfile
echo "MINSTART=$MINSTART" >>$tmpfile
echo "MINSTOP=$MINSTOP" >>$tmpfile
[ -n "$MINPWM" ] && echo "MINPWM=$MINPWM" >>$tmpfile
[ -n "$MAXPWM" ] && echo "MAXPWM=$MAXPWM" >>$tmpfile
mv $tmpfile $FCCONFIG