3 currentfile=interwiki.map
4 backupfile=/tmp/${currentfile}.bak
5 downloadfile=/tmp/intermap.txt
6 newfile=/tmp/${currentfile}
7 tempfile=/tmp/intermap.tmp
9 echo "Downloading latest InterWikiMap from PhpWiki CVS"
12 echo "Downloading latest InterWikiMap from Usemod"
13 curl http://usemod.com/intermap.txt -o ${downloadfile}
15 echo "Backing up current ${currentfile} to ${backupfile}"
16 cp -p ${currentfile} ${backupfile}
18 echo "merging ${downloadfile} with installed ${currentfile}"
19 cat ${downloadfile} > ${tempfile}
20 cat ${backupfile} >> ${tempfile}
21 cat ${tempfile} | sort -f | uniq > ${newfile}
23 echo "Installing updated InterWikiMap"
24 install -m 0644 ${newfile} ${currentfile}
25 rm ${downloadfile} ${tempfile} ${newfile}
27 echo "The following new InterWikiMap entries were found:"
28 diff -u0 ${backupfile} ${currentfile}
30 echo "Comparing with PhpWiki CVS:"
31 cvs diff ${currentfile}
33 echo "*** You must check ${currentfile} for duplicates or other problems. ***"
34 echo "*** The backup file is: ${backupfile}. ***"