~ubuntu-branches/ubuntu/lucid/powernowd/lucid

« back to all changes in this revision

Viewing changes to debian/init.d

  • Committer: Bazaar Package Importer
  • Author(s): Bdale Garbee
  • Date: 2004-11-29 02:18:06 UTC
  • Revision ID: james.westby@ubuntu.com-20041129021806-dja38tawf5qx5sso
Tags: 0.90-3
* fix a typo in the man page, closes: #270390
* conflict with cpudyn and cpufreqd, closes: #281067
* update README.Debian to reflect current kernel info, closes: #281066

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
 
 
3
PATH=/sbin:/bin:/usr/sbin:/usr/bin
 
4
DAEMON=/usr/sbin/powernowd
 
5
NAME=powernowd
 
6
DESC=powernowd
 
7
 
 
8
test -x $DAEMON || exit 0
 
9
 
 
10
# create the file /etc/default/powernowd if you want to override the value of
 
11
# variable OPTIONS and change the default behavior of the daemon as launched
 
12
 
 
13
OPTIONS="-q"
 
14
[ -f /etc/default/$NAME ] && . /etc/default/$NAME
 
15
 
 
16
set -e
 
17
 
 
18
case "$1" in
 
19
  start)
 
20
        echo -n "Starting $DESC: "
 
21
        if [ -f /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor ]
 
22
        then
 
23
                start-stop-daemon --start --quiet --oknodo --exec $DAEMON -- $OPTIONS
 
24
        else
 
25
                echo "required sysfs objects not found!"
 
26
                echo -e "\tRead /usr/share/doc/powernowd/README.Debian for more information."
 
27
                exit 0
 
28
        fi
 
29
        echo "$NAME."
 
30
        ;;
 
31
  stop)
 
32
        echo -n "Stopping $DESC: "
 
33
        start-stop-daemon --stop --quiet --oknodo --exec $DAEMON
 
34
        echo "$NAME."
 
35
        ;;
 
36
  restart|force-reload)
 
37
        echo -n "Restarting $DESC: "
 
38
        start-stop-daemon --stop --quiet --oknodo --exec $DAEMON
 
39
        sleep 1
 
40
        start-stop-daemon --start --quiet --oknodo --exec $DAEMON -- $OPTIONS
 
41
        echo "$NAME."
 
42
        ;;
 
43
  *)
 
44
        N=/etc/init.d/$NAME
 
45
        echo "Usage: $N {start|stop|restart|force-reload}" >&2
 
46
        exit 1
 
47
        ;;
 
48
esac
 
49
 
 
50
exit 0