3 # Purpose: script for use inside GNU screen
4 # Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports: see http://grml.org/bugs/
6 # License: This file is licensed under the GPL v2.
7 ################################################################################
9 if [ -r /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq ] ; then
10 TMP=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq` && \
11 CUR="`echo "scale=0; $TMP/1000" | bc -l` / "
13 [ -z "$CUR" ] && CUR=''
16 if ! [ -d /proc ] ; then
17 echo "no /proc" && exit
19 if [ -r /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq ] ; then
20 TMP=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq` && \
21 MHZ=`echo "scale=0; $TMP/1000" | bc -l`
23 MHZ=$(grep 'cpu MHz' /proc/cpuinfo | sed 's/.*: // ; s/\..*//')
25 MULT=$(echo "$MHZ" | wc -l)
26 if [ $MULT -gt 1 ] ; then
27 RESULT=$(echo "$MHZ" | head -1)
28 echo "$CUR${RESULT}*${MULT}"
34 ## END OF FILE #################################################################