ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cfmaps/cfupdate
Revision: 1.4
Committed: Fri Nov 18 23:33:09 2005 UTC (18 years, 6 months ago) by root
Branch: MAIN
Changes since 1.3: +1 -1 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.1 #!/bin/bash
2    
3     umask 022
4    
5     PATH=/root/src/crossfire:$PATH
6     BASE=/var/www/cfmaps.schmorp.de
7     export CROSSFIRE_LIBDIR=$BASE/lib
8    
9     cd "$BASE" || exit 69
10    
11 root 1.3 VERSION=1.0
12    
13 root 1.1 cvs -Q -z3 update -AdP | grep -v ^\\?
14    
15     rm -f .cfmap2html
16    
17     find . -name CVS -prune -o -type d -printf "%P/\n" | while read dir; do
18     (
19     export dir
20     cd "./$dir" || exit 68
21     {
22 root 1.3 echo "<html><head><title>Crossfire Maps: $dir</title></head><body><h1>Crossfire Maps $dir</h1><h2>This Directory</h2><ul>" >&7
23 root 1.1 echo "<li><a href='..'>&lt;parent&gt;</a></li>" >&7
24     for file in *; do
25     if [ -f "$file" ]; then
26     case "$file" in
27     *.pst | *.jpg | *.png | *.html | *.html.gz | *~ )
28     ;;
29     * )
30     if head -5 "$file" | grep -q "^arch map"; then
31     echo "<li><a href='$file.html'>$file</a> [map]</li>" >&7
32     DIR="${dir#/}"
33     echo "$DIR$file" >>$BASE/.cfmap2html
34     else
35     echo "<li><a href='$file'>$file</a> [file]</li>" >&7
36     fi
37     ;;
38     esac
39     elif [ -d "$file" ]; then
40     case "$file" in
41     CVS )
42     ;;
43     * )
44     echo "<li><a href='$file/'>$file/</a> [dir]</li>" >&7
45     ;;
46     esac
47     fi
48     done
49 root 1.3 echo "</ul>" >&7
50     cat <<EOF >&7
51     <h2>Bookmarks</h2>
52     <ul>
53 root 1.4 <li><a href="/world/">Worldmap</a></li>
54 root 1.3 <li><a href="/world/world_105_115.html">Scorn</a></li>
55     <li><a href="/world/world_102_108.html">Santo Dominion</a></li>
56     <li><a href="/world/world_107_123.html">Brest</a></li>
57     <li><a href="/world/world_109_126.html">Lake Country</a></li>
58     <li><a href="/world/world_122_117.html">Navar</a></li>
59     <li><a href="/world/world_116_102.html">Darcap</a></li>
60     <li><a href="/world/world_128_109.html">Wolfsburg</a></li>
61     <li><a href="/world/world_128_101.html">Azumauindo</a></li>
62     </ul>
63     <hr />
64     <p style='font-size: 8pt;'>created by <b>update</b> version $VERSION</p>
65     EOF
66     echo "</body></html>" >&7
67 root 1.1 } 7>index.html
68     )
69     done
70    
71     <.cfmap2html xargs cfmap2html
72 root 1.2 rm -f .cfmap2html
73    
74     cfarch2html
75 root 1.3 cfworldmap
76    
77     chown -R root.root .
78     chmod -R u=rwX,go=rX .
79 root 1.2