Changeset 6001
- Timestamp:
- 12/04/11 17:54:05 (6 months ago)
- Location:
- lm-sensors/trunk
- Files:
-
- 2 modified
-
CHANGES (modified) (1 diff)
-
prog/pwm/fancontrol (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/CHANGES
r6000 r6001 4 4 SVN HEAD 5 5 fancontrol: Support setup where one PWM output controls several fans 6 Output error messages to stderr 6 7 sensors-detect: Stop calling for PIIX5 SMBus testers 7 8 Improve filtering of fake DMI data -
lm-sensors/trunk/prog/pwm/fancontrol
r6000 r6001 50 50 if [ ! -r "$1" ] 51 51 then 52 echo "Error: Can't read configuration file" 52 echo "Error: Can't read configuration file" >&2 53 53 exit 1 54 54 fi … … 71 71 if [[ -z ${INTERVAL} || -z ${FCTEMPS} || -z ${MINTEMP} || -z ${MAXTEMP} || -z ${MINSTART} || -z ${MINSTOP} ]] 72 72 then 73 echo "Some mandatory settings missing, please check your config file!" 73 echo "Some mandatory settings missing, please check your config file!" >&2 74 74 exit 1 75 75 fi 76 76 if [ "$INTERVAL" -le 0 ] 77 77 then 78 echo "Error in configuration file:" 79 echo "INTERVAL must be at least 1" 78 echo "Error in configuration file:" >&2 79 echo "INTERVAL must be at least 1" >&2 80 80 exit 1 81 81 fi … … 91 91 if ! echo $fcv | egrep -q '=' 92 92 then 93 echo "Error in configuration file:" 94 echo "FCTEMPS value is improperly formatted" 93 echo "Error in configuration file:" >&2 94 echo "FCTEMPS value is improperly formatted" >&2 95 95 exit 1 96 96 fi … … 111 111 if [ "${AFCMINTEMP[$fcvcount]}" -ge "${AFCMAXTEMP[$fcvcount]}" ] 112 112 then 113 echo "Error in configuration file (${AFCPWM[$fcvcount]}):" 114 echo "MINTEMP must be less than MAXTEMP" 113 echo "Error in configuration file (${AFCPWM[$fcvcount]}):" >&2 114 echo "MINTEMP must be less than MAXTEMP" >&2 115 115 exit 1 116 116 fi 117 117 if [ "${AFCMAXPWM[$fcvcount]}" -gt 255 ] 118 118 then 119 echo "Error in configuration file (${AFCPWM[$fcvcount]}):" 120 echo "MAXPWM must be at most 255" 119 echo "Error in configuration file (${AFCPWM[$fcvcount]}):" >&2 120 echo "MAXPWM must be at most 255" >&2 121 121 exit 1 122 122 fi 123 123 if [ "${AFCMINSTOP[$fcvcount]}" -ge "${AFCMAXPWM[$fcvcount]}" ] 124 124 then 125 echo "Error in configuration file (${AFCPWM[$fcvcount]}):" 126 echo "MINSTOP must be less than MAXPWM" 125 echo "Error in configuration file (${AFCPWM[$fcvcount]}):" >&2 126 echo "MINSTOP must be less than MAXPWM" >&2 127 127 exit 1 128 128 fi 129 129 if [ "${AFCMINSTOP[$fcvcount]}" -lt "${AFCMINPWM[$fcvcount]}" ] 130 130 then 131 echo "Error in configuration file (${AFCPWM[$fcvcount]}):" 132 echo "MINSTOP must be greater than or equal to MINPWM" 131 echo "Error in configuration file (${AFCPWM[$fcvcount]}):" >&2 132 echo "MINSTOP must be greater than or equal to MINPWM" >&2 133 133 exit 1 134 134 fi 135 135 if [ "${AFCMINPWM[$fcvcount]}" -lt 0 ] 136 136 then 137 echo "Error in configuration file (${AFCPWM[$fcvcount]}):" 138 echo "MINPWM must be at least 0" 137 echo "Error in configuration file (${AFCPWM[$fcvcount]}):" >&2 138 echo "MINPWM must be at least 0" >&2 139 139 exit 1 140 140 fi … … 186 186 if [ "`DevicePath "$device"`" != "$path" ] 187 187 then 188 echo "Device path of $device has changed" 188 echo "Device path of $device has changed" >&2 189 189 outdated=1 190 190 fi … … 198 198 if [ "`DeviceName "$device"`" != "$name" ] 199 199 then 200 echo "Device name of $device has changed" 200 echo "Device name of $device has changed" >&2 201 201 outdated=1 202 202 fi … … 216 216 if [ ! -w $pwmo ] 217 217 then 218 echo "Error: file $pwmo doesn't exist" 218 echo "Error: file $pwmo doesn't exist" >&2 219 219 outdated=1 220 220 fi … … 228 228 if [ ! -r $tsen ] 229 229 then 230 echo "Error: file $tsen doesn't exist" 230 echo "Error: file $tsen doesn't exist" >&2 231 231 outdated=1 232 232 fi … … 242 242 if [ ! -r $fan ] 243 243 then 244 echo "Error: file $fan doesn't exist" 244 echo "Error: file $fan doesn't exist" >&2 245 245 outdated=1 246 246 fi … … 251 251 if [ $outdated -eq 1 ] 252 252 then 253 echo 254 echo "At least one referenced file is missing. Either some required kernel" 255 echo "modules haven't been loaded, or your configuration file is outdated." 256 echo "In the latter case, you should run pwmconfig again." 253 echo >&2 254 echo "At least one referenced file is missing. Either some required kernel" >&2 255 echo "modules haven't been loaded, or your configuration file is outdated." >&2 256 echo "In the latter case, you should run pwmconfig again." >&2 257 257 fi 258 258 … … 278 278 DIR=/sys/bus/i2c/devices 279 279 else 280 echo "$0: Invalid path to sensors" 280 echo "$0: Invalid path to sensors" >&2 281 281 exit 1 282 282 fi … … 284 284 if [ ! -d $DIR ] 285 285 then 286 echo $0: 'No sensors found! (did you load the necessary modules?)' 286 echo $0: 'No sensors found! (did you load the necessary modules?)' >&2 287 287 exit 1 288 288 fi … … 292 292 if [ -z "$DEVPATH" -o -z "$DEVNAME" ] 293 293 then 294 echo "Configuration is too old, please run pwmconfig again" 294 echo "Configuration is too old, please run pwmconfig again" >&2 295 295 exit 1 296 296 fi 297 297 if ! ValidateDevices "$DEVPATH" "$DEVNAME" 298 298 then 299 echo "Configuration appears to be outdated, please run pwmconfig again" 299 echo "Configuration appears to be outdated, please run pwmconfig again" >&2 300 300 exit 1 301 301 fi … … 304 304 if [ -f "$PIDFILE" ] 305 305 then 306 echo "File $PIDFILE exists, is fancontrol already running?" 306 echo "File $PIDFILE exists, is fancontrol already running?" >&2 307 307 exit 1 308 308 fi … … 417 417 if [ $? -ne 0 ] 418 418 then 419 echo "Error reading Fan value from $DIR/$one_fan" 419 echo "Error reading Fan value from $DIR/$one_fan" >&2 420 420 restorefans 1 421 421 fi … … 474 474 if [ $? -ne 0 ] 475 475 then 476 echo "Error writing PWM value to $DIR/$pwmo" 476 echo "Error writing PWM value to $DIR/$pwmo" >&2 477 477 restorefans 1 478 478 fi … … 493 493 if [ $? -ne 0 ] 494 494 then 495 echo "Error enabling PWM on $DIR/$pwmo" 495 echo "Error enabling PWM on $DIR/$pwmo" >&2 496 496 restorefans 1 497 497 fi
