#!/bin/sh bold=$(tput bold) red=$(tput setaf 1) green=$(tput setaf 2) reset=$(tput sgr0) syspath="/sys/devices/system/cpu/intel_pstate/no_turbo" case "$1" in on) echo 0 > $syspath ;; off) echo 1 > $syspath ;; *) echo "Usage: $0 on|off" echo echo -n "Current turbo status: " status=$(cat $syspath) if [ "$status" = "0" ]; then echo "${bold}${green}enabled${reset}" else echo "${bold}${red}disabled${reset}" fi ;; esac