]> git.pld-linux.org Git - packages/cpudyn.git/blame - cpudyn.init
- tabs in preamble
[packages/cpudyn.git] / cpudyn.init
CommitLineData
eb2ee685 1#! /bin/sh
2#
3# Written by Celso Gonzalez <celso@bulma.net>.
fa548491 4#
eb2ee685 5# based in skeleton example file provided by Debian.
6#
7# Version: @(#)cpudyn 0.4.0 30-Jul-2003 celso@bulma.net
8#
9
10PATH=/sbin:/bin:/usr/sbin:/usr/bin
11DAEMON=/sbin/cpudynd
12NAME=cpudyn
13DESC=cpudyn
14CONFFILE=/etc/cpudyn.conf
15PIDFILE=/var/run/$NAME.pid
16
17test -x $DAEMON || exit 0
18test -e $CONFFILE || exit 0
19
20# Read the configuration file
21. $CONFFILE
22
23OPTS=""
24if [ ! -z "$INTERVAL" ]; then OPTS="$OPTS -i $INTERVAL"; fi
25if [ ! -z "$CPU_UP" -a ! -z "$CPU_DOWN" ]; then OPTS="$OPTS -p $CPU_UP $CPU_DOWN"; fi
26if [ ! -z "$THROTTLING_LOW" ]; then OPTS="$OPTS -l $THROTTLING_LOW"; fi
27if [ ! -z "$TIMEOUT" ]; then OPTS="$OPTS -t $TIMEOUT"; fi
28if [ ! -z "$DISKS" ]; then OPTS="$OPTS -h $DISKS"; fi
29
30set -e
31
32case "$1" in
33 start)
34 echo -n "Starting $DESC: "
35 start-stop-daemon --start --quiet --pidfile $PIDFILE \
36 --background --make-pidfile --exec $DAEMON -- $OPTS
37 echo "$NAME."
38 ;;
39 stop)
40 echo -n "Stopping $DESC: "
41 start-stop-daemon --stop --quiet --pidfile $PIDFILE \
42 --exec $DAEMON && rm -f $PIDFILE
43 echo "$NAME."
44 ;;
45 restart|force-reload)
46 echo -n "Restarting $DESC: "
47 start-stop-daemon --stop --quiet --pidfile $PIDFILE \
48 --exec $DAEMON && rm -f $PIDFILE
49 sleep 1
50 start-stop-daemon --start --quiet --pidfile $PIDFILE \
51 --background --make-pidfile --exec $DAEMON -- $OPTS
52 echo "$NAME."
53 ;;
54 *)
55 N=/etc/init.d/$NAME
56 echo "Usage: $N {start|stop|restart|force-reload}" >&2
57 exit 1
58 ;;
59esac
60
61exit 0
This page took 0.055208 seconds and 4 git commands to generate.