From 9e035594d98a74c6bfa4e091fae242345828420a Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Sun, 29 Sep 2013 18:56:30 +0200 Subject: [PATCH] processor: fix to avoid reporting script execution error on log --- postplug.d/07processor | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/postplug.d/07processor b/postplug.d/07processor index 8688a60..16c538e 100644 --- a/postplug.d/07processor +++ b/postplug.d/07processor @@ -7,30 +7,24 @@ [ -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 - - CPUVENDOR=AMD - if [ "`echo $CPUMODEL | grep X2`" ]; then - LOAD_MODULE=powernow_k8 - elif [ "`echo $CPUMODEL | grep Athlon`" ]; then - LOAD_MODULE=k8temp - elif [ "`echo $CPUMODEL | grep Thurion`" ]; then - LOAD_MODULE=k8temp - else - LOAD_MODULE=acpi_cpufreq - fi - - elif [ "`echo $CPUMODEL | grep Intel`" ]; then - - CPUVENDOR=Intel +if [ "`echo $CPUMODEL | grep AMD`" ]; then + CPUVENDOR=AMD + if [ "`echo $CPUMODEL | grep X2`" ]; then + LOAD_MODULE=powernow_k8 + elif [ "`echo $CPUMODEL | grep Athlon`" ]; then + LOAD_MODULE=k8temp + elif [ "`echo $CPUMODEL | grep Thurion`" ]; then + LOAD_MODULE=k8temp + else 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 - -} +elif [ "`echo $CPUMODEL | grep Intel`" ]; then + CPUVENDOR=Intel + 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