User:Jasonjason/sandbox2: Difference between revisions

From The Urban Dead Wiki
Jump to navigationJump to search
No edit summary
(cleaning up some sand...)
 
Line 1: Line 1:
'''Daily auto-updating UDtool list on Linux with the RG list and the zerg liste which requires no work on your part once it's set up. Commands that should be typed at the command line start with $ to indicate your command prompt, omit it if copy/pasting commands into your terminal.'''
I finished what I was working on here and moved it to: [[User:Jasonjason/UDtoolList]]
 
Make a folder to house scripts, if you don't already have one:
<code><nowiki>$ mkdir scripts</nowiki></code>
 
And edit your path so that you can run scripts there
<code><nowiki>$ PATH=$PATH:~/scripts</nowiki></code>
 
Copy and paste this and save it as updateUDtool.sh in your scripts folder:
<code><nowiki>#!/bin/bash</nowiki></code>
<code><nowiki># removing the old list to start</nowiki></code>
<code><nowiki>rm ~/UDtoolList.txt</nowiki></code>
<code><nowiki># colors for the lists come first</nowiki></code>
<code><nowiki>echo "#00ff64,Zergs</nowiki></code>
<code><nowiki>#770000,Wanted</nowiki></code>
<code><nowiki>#FF7256,Past PKers" > ~/UDtoolList.txt</nowiki></code>
<code><nowiki># grabbin' the zerg list</nowiki></code>
<code><nowiki>wget -O ~/zerglist.txt http://zombies.dementiastudios.org/boards/index.php?topic=12.0</nowiki></code>
<code><nowiki>sed 's/<br \/>/\n/g' ~/zerglist.txt | grep "Zergs,Zerger" >> ~/UDtoolList.txt</nowiki></code>
<code><nowiki># grabbin' the RG list</nowiki></code>
<code><nowiki>curl -d State="UD Tool list" "http://www.ud-malton.info/Rogues_Gallery.cgi" | grep -v "#" >> ~/UDtoolList.txt</nowiki></code>
<code><nowiki>rm ~/zerglist.txt</nowiki></code>
 
Make the file executable:
<code><nowiki>$ chmod +x ~/scripts/updateUDtool.sh</nowiki></code>
 
Run it for the first time:
<code><nowiki>$ ~/scripts/updateUDtool.sh</nowiki></code>
 
Now change your UDtool settings to use the new list, called UDtoolList.txt and located in your home folder.
 
Now, copy paste this to a text editor and save it as updateUDtool.cron in your scripts folder
<code><nowiki>20 4 * * * ~/scripts/updateUDtool.sh</nowiki></code>
 
And type this in your terminal to set that as a cron job:
<code><nowiki>$ crontab ~/scripts/updateUDtool.cron</nowiki></code>
 
Then, your UD tool list will be updated every day at 4:20 am. You can change the time by changing the updateUDtool.cron file. If you found this useful, let me know.

Latest revision as of 21:59, 5 March 2010

I finished what I was working on here and moved it to: User:Jasonjason/UDtoolList