View previous topic :: View next topic |
Author |
Message |
La`res Arch/Herd Tester
Joined: 11 Aug 2003 Posts: 79 Location: ::0
|
Posted: Fri Oct 29, 2004 4:37 am Post subject: letsPlay.sh; runlevel wrapper for gaming |
|
|
The Following script is used to switch runlevel before and after playing a game, in order to free up all the possible resources so your gaming experience is that much nicer.
First Make a Gaming runlevel.
Code: | cd /etc/runlevels
mkdir gaming
rc-update add <the scripts needed to during gaming> gaming |
ie. if you want syslog, cron and net running while gaming
Code: | rc-update add syslog gaming
rc-update add cron gaming
rc-update add net gaming |
Keep going until you have all the options needed.
Add this script to /usr/local/bin, or any other $PATH of your choice
Code: | #!/bin/sh
# letsPlay.sh
###
# Begin USER Config
GAMERUNLEVEL="gaming"
NORMALRUNLEVEL="default"
### END user Config
if [ -x /usr/bin/sudo ]; then
sudo /sbin/rc $GAMERUNLEVEL
$1
sudo /sbin/rc $NORMALRUNLEVEL;
else
echo "You need to have sudo installed"
echo "emerge sudo :)"
exit 1;
fi |
Now
Code: | cd /usr/local/bin
chown root:games letsPlay.sh
chmod 554 letsPlay.sh |
And that is it...
To use just execute
Code: | letsPlay.sh <game Of choice> |
Questions? Comments? Concerns? -> QCC
Post On! _________________ Lares Moreau <lares.moreau@gmail.com>
LRU: 400755 http://counter.li.org
lares/irc.freenode.net |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|