]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - admin/updateinterwikimap
function _PageList_Column* are not private
[SourceForge/phpwiki.git] / admin / updateinterwikimap
1 #!/bin/sh
2 # cd lib
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
9
10 echo "Downloading latest InterWikiMap from PhpWiki SVN"
11 svns up ${currentfile}
12
13 echo "Downloading latest InterWikiMap from Usemod"
14 curl http://usemod.com/intermap.txt -o ${downloadfile}
15
16 echo "Backing up current ${currentfile} to ${backupfile}"
17 cp -p ${currentfile} ${backupfile}
18
19 echo "merging ${downloadfile} with installed ${currentfile}"
20 cat ${downloadfile} > ${tempfile}
21 cat ${backupfile} >> ${tempfile}
22 cat ${tempfile} | sort -f | uniq > ${newfile}
23
24 echo "Installing updated InterWikiMap"
25 install -m 0644 ${newfile} ${currentfile}
26 rm ${downloadfile} ${tempfile} ${newfile}
27
28 echo "The following new InterWikiMap entries were found:"
29 diff -u0 ${backupfile} ${currentfile}
30
31 echo "Comparing with PhpWiki SVN:"
32 svn diff ${currentfile}
33
34 echo "*** You must check ${currentfile} for duplicates or other problems. ***"
35 echo "*** The backup file is: ${backupfile}. ***"
36
37 echo "Done."