3 # ../admin/updateinterwikimap
4 currentfile=interwiki.map
5 backupfile=/tmp/${currentfile}.bak
6 downloadfile=/tmp/intermap.txt
7 newfile=/tmp/${currentfile}
8 tempfile=/tmp/intermap.tmp
10 echo "Downloading latest InterWikiMap from PhpWiki SVN"
11 svns up ${currentfile}
13 echo "Downloading latest InterWikiMap from Usemod"
14 curl http://usemod.com/intermap.txt -o ${downloadfile}
16 echo "Backing up current ${currentfile} to ${backupfile}"
17 cp -p ${currentfile} ${backupfile}
19 echo "merging ${downloadfile} with installed ${currentfile}"
20 cat ${downloadfile} > ${tempfile}
21 cat ${backupfile} >> ${tempfile}
22 cat ${tempfile} | sort -f | uniq > ${newfile}
24 echo "Installing updated InterWikiMap"
25 install -m 0644 ${newfile} ${currentfile}
26 rm ${downloadfile} ${tempfile} ${newfile}
28 echo "The following new InterWikiMap entries were found:"
29 diff -u0 ${backupfile} ${currentfile}
31 echo "Comparing with PhpWiki SVN:"
32 svn diff ${currentfile}
34 echo "*** You must check ${currentfile} for duplicates or other problems. ***"
35 echo "*** The backup file is: ${backupfile}. ***"