Skip to content

Instantly share code, notes, and snippets.

@liferealized
Created November 16, 2011 16:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save liferealized/1370598 to your computer and use it in GitHub Desktop.
Save liferealized/1370598 to your computer and use it in GitHub Desktop.
Start up script for debian system that uses atitweak to set gpu fan speeds
#!/bin/bash
# Author: Patrick "p2k" Schneider <me@p2k-network.org>
# Donate: 166rK7eEVgnGvs9aA7jvu8NoPv8KzbPQ3L
# Install rcX.d scripts: update-rc.d atitweak defaults
# Uninstall: update-rc.d -f atitweak remove
### BEGIN INIT INFO
# Provides: atitweak
# Should-Start: console-screen hal
# Required-Start: $local_fs $remote_fs x11-common gdm
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Tweaks ATI cards.
# Description: Like I said, tweaks ATI cards.
### END INIT INFO
if test -f /etc/default/atitweak; then
. /etc/default/atitweak
fi
. /lib/lsb/init-functions
PATH=/sbin:/bin:/usr/sbin:/usr/bin::/usr/local/sbin:/usr/local/bin
case "$1" in
start|restart|reload|force-reload)
log_daemon_msg "Tweaking ATI cards" "atitweak"
if test $NUM_ADAPTERS -eq 0; then
atitweak $ATITWEAK_OPTIONS >/dev/null
log_end_msg $?
else
for (( i=0; i<NUM_ADAPTERS; i++ )); do
atitweak -A $i $ATITWEAK_OPTIONS >/dev/null
done
log_end_msg 0
fi
;;
stop)
# No-op
;;
*)
log_action_msg "Usage: $0 {start|stop|restart|reload|force-reload|status}"
exit 1
;;
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment