File: updateinterwikimap

package info (click to toggle)
fusionforge 5.3.2%2B20141104-3%2Bdeb8u3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-updates
  • size: 60,468 kB
  • ctags: 75,803
  • sloc: php: 271,850; sql: 36,817; python: 14,575; perl: 6,406; sh: 5,980; xml: 4,294; pascal: 1,411; makefile: 911; cpp: 52; awk: 27
file content (37 lines) | stat: -rw-r--r-- 1,077 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
# cd lib
# ../admin/updateinterwikimap
currentfile=interwiki.map
backupfile=/tmp/${currentfile}.bak
downloadfile=/tmp/intermap.txt
newfile=/tmp/${currentfile}
tempfile=/tmp/intermap.tmp

echo "Downloading latest InterWikiMap from PhpWiki SVN"
svns up ${currentfile}

echo "Downloading latest InterWikiMap from Usemod"
curl http://usemod.com/intermap.txt -o ${downloadfile}

echo "Backing up current ${currentfile} to ${backupfile}"
cp -p ${currentfile} ${backupfile}

echo "merging ${downloadfile} with installed ${currentfile}"
cat ${downloadfile} > ${tempfile}
cat ${backupfile} >> ${tempfile}
cat ${tempfile} | sort -f | uniq > ${newfile}

echo "Installing updated InterWikiMap"
install -m 0644 ${newfile} ${currentfile}
rm ${downloadfile} ${tempfile} ${newfile}

echo "The following new InterWikiMap entries were found:"
diff -u0 ${backupfile} ${currentfile}

echo "Comparing with PhpWiki SVN:"
svn diff ${currentfile}

echo "*** You must check ${currentfile} for duplicates or other problems. ***"
echo "*** The backup file is: ${backupfile}. ***"

echo "Done."