processor: fix to avoid reporting script execution error on log

This commit is contained in:
Silvan Calarco 2013-09-29 18:56:30 +02:00
parent 29c1787405
commit 9e035594d9

View File

@ -7,30 +7,24 @@
[ -e /etc/sysconfig/acpi ] && . /etc/sysconfig/acpi [ -e /etc/sysconfig/acpi ] && . /etc/sysconfig/acpi
[ "$CPU_FREQ" = "" ] && { [ "$CPU_FREQ" ] && exit 0
CPUMODEL=`cat /proc/cpuinfo | grep "model name" -m1 | sed "s|model name[[:space:]*]:\(.*\)|\1|" ` CPUMODEL=`cat /proc/cpuinfo | grep "model name" -m1 | sed "s|model name[[:space:]*]:\(.*\)|\1|" `
if [ "`echo $CPUMODEL | grep AMD`" ]; then if [ "`echo $CPUMODEL | grep AMD`" ]; then
CPUVENDOR=AMD
CPUVENDOR=AMD if [ "`echo $CPUMODEL | grep X2`" ]; then
if [ "`echo $CPUMODEL | grep X2`" ]; then LOAD_MODULE=powernow_k8
LOAD_MODULE=powernow_k8 elif [ "`echo $CPUMODEL | grep Athlon`" ]; then
elif [ "`echo $CPUMODEL | grep Athlon`" ]; then LOAD_MODULE=k8temp
LOAD_MODULE=k8temp elif [ "`echo $CPUMODEL | grep Thurion`" ]; then
elif [ "`echo $CPUMODEL | grep Thurion`" ]; then LOAD_MODULE=k8temp
LOAD_MODULE=k8temp else
else
LOAD_MODULE=acpi_cpufreq
fi
elif [ "`echo $CPUMODEL | grep Intel`" ]; then
CPUVENDOR=Intel
LOAD_MODULE=acpi_cpufreq LOAD_MODULE=acpi_cpufreq
fi fi
elif [ "`echo $CPUMODEL | grep Intel`" ]; then
[ -e /etc/sysconfig/acpi ] && sed -i "/CPU_FREQ=.*/d" /etc/sysconfig/acpi CPUVENDOR=Intel
echo "CPU_FREQ=$LOAD_MODULE" >> /etc/sysconfig/acpi LOAD_MODULE=acpi_cpufreq
fi
} [ -e /etc/sysconfig/acpi ] && sed -i "/CPU_FREQ=.*/d" /etc/sysconfig/acpi
echo "CPU_FREQ=$LOAD_MODULE" >> /etc/sysconfig/acpi