updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / rovclock / rovclock.init
blobe5751568f6778fb1761f4ab8ccc42cc773d1b9ad
1 #!/bin/sh
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 [ -f /etc/conf.d/rovclock ] && . /etc/conf.d/rovclock
8 case "$1" in
9 start)
10 stat_busy "Starting RadeonOverclock"
11 _CPU_SPEED=`rovclock -i | tail -n 1 | sed 's/Core: \(.*\) MHz,.*/\1/'`
12 _MEM_SPEED=`rovclock -i | tail -n 1 | sed 's/.*, Mem: \(.*\) MHz/\1/'`
13 echo 'CPU_FREQ='${_CPU_SPEED} > /var/run/rovclock
14 echo 'MEM_FREQ='${_MEM_SPEED}>> /var/run/rovclock
15 rovclock -c ${CPU_FREQ} -m ${MEM_FREQ} > /dev/null
17 if [ $? -eq 0 ] ; then
18 add_daemon rovclock
19 stat_done
20 else
21 stat_fail
24 stop)
25 stat_busy "Stopping RadeonOverclock"
26 . /var/run/rovclock
27 rovclock -c ${CPU_FREQ} -m ${MEM_FREQ} > /dev/null
28 if [ $? -eq 0 ] ; then
29 rm_daemon rovclock
30 stat_done
31 else
32 stat_fail
36 restart)
37 $0 start
40 echo "usage: $0 {start|stop|restart}"
41 esac
42 exit 0