Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

an init script to set some personal stuff

  • Loading branch information...
commit e678a11615fb9200e390f9e9a611bc0af4214a30 1 parent 8024005
authored May 05, 2012

Showing 1 changed file with 43 additions and 0 deletions. Show diff stats Hide diff stats

  1. 43  vince-mod
43  vince-mod
... ...
@@ -0,0 +1,43 @@
  1
+#!/bin/sh
  2
+### BEGIN INIT INFO
  3
+# Provides:       vince-mod
  4
+# Required-Start: $remote_fs cpufrequtils
  5
+# Required-Stop:
  6
+# Default-Start:  2 3 4 5
  7
+# Default-Stop:
  8
+# Short-Description: set some personal modifications
  9
+# Description: Collections of personal settings that should be set at
  10
+# 	       start up.
  11
+### END INIT INFO
  12
+# 
  13
+
  14
+DESC="personal modifications"
  15
+
  16
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
  17
+
  18
+# use lsb-base
  19
+. /lib/lsb/init-functions
  20
+
  21
+set_cpufreq_up_and_down_threshold() {
  22
+    current_governor=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)
  23
+    if [ -n "$current_governor" ] && [ $current_governor = "conservative" ]; then
  24
+	log_action_cont_msg "Setting cpufreq thresholds."
  25
+	echo -n 95 > /sys/devices/system/cpu/cpufreq/conservative/up_threshold
  26
+	echo -n 40 > /sys/devices/system/cpu/cpufreq/conservative/down_threshold
  27
+    fi
  28
+}
  29
+
  30
+case "$1" in
  31
+    start|force-reload|restart|reload)
  32
+	log_action_begin_msg "$DESC: "
  33
+	set_cpufreq_up_and_down_threshold
  34
+	log_action_end_msg 0 ""
  35
+	;;
  36
+    stop)
  37
+	;;
  38
+    *)
  39
+	echo "Usage: $0 {start|stop|restart|reload|force-reload}"
  40
+	exit 1
  41
+esac
  42
+
  43
+exit 0

0 notes on commit e678a11

Please sign in to comment.
Something went wrong with that request. Please try again.