User:Jasonjason/UDtoolList

From The Urban Dead Wiki
< User:Jasonjason
Revision as of 21:18, 5 March 2010 by Jasonjason (talk | contribs) (out of the sandbox, you. This needs its own page.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

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.

Make a folder to house scripts, if you don't already have one:

$ mkdir scripts

And edit your path so that you can run scripts there

$ PATH=$PATH:~/scripts

Copy and paste this and save it as updateUDtool.sh in your scripts folder:

#!/bin/bash
# removing the old list to start
rm ~/UDtoolList.txt
# colors for the lists come first
echo "#00ff64,Zergs
#770000,Wanted
#FF7256,Past PKers" > ~/UDtoolList.txt
# grabbin' the zerg list
wget -O ~/zerglist.txt http://zombies.dementiastudios.org/boards/index.php?topic=12.0
sed 's/<br \/>/\n/g' ~/zerglist.txt | grep "Zergs,Zerger" >> ~/UDtoolList.txt
# grabbin' the RG list
curl -d State="UD Tool list" "http://www.ud-malton.info/Rogues_Gallery.cgi" | grep -v "#" >> ~/UDtoolList.txt
rm ~/zerglist.txt

Make the file executable:

$ chmod +x ~/scripts/updateUDtool.sh

Run it for the first time:

$ ~/scripts/updateUDtool.sh

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

20 4 * * * ~/scripts/updateUDtool.sh

And type this in your terminal to set that as a cron job:

$ crontab ~/scripts/updateUDtool.cron

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.