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 |
|
|
cvs -Q -z3 update -AdP | grep -v ^\\? |
12 |
|
|
|
13 |
|
|
chown -R root.root . |
14 |
|
|
chmod -R u=rwX,go=rX . |
15 |
|
|
|
16 |
|
|
rm -f .cfmap2html |
17 |
|
|
|
18 |
|
|
find . -name CVS -prune -o -type d -printf "%P/\n" | while read dir; do |
19 |
|
|
( |
20 |
|
|
export dir |
21 |
|
|
cd "./$dir" || exit 68 |
22 |
|
|
{ |
23 |
|
|
echo "<html><head><title>$dir</title></head><body><ul>" >&7 |
24 |
|
|
echo "<li><a href='..'><parent></a></li>" >&7 |
25 |
|
|
for file in *; do |
26 |
|
|
if [ -f "$file" ]; then |
27 |
|
|
case "$file" in |
28 |
|
|
*.pst | *.jpg | *.png | *.html | *.html.gz | *~ ) |
29 |
|
|
;; |
30 |
|
|
* ) |
31 |
|
|
if head -5 "$file" | grep -q "^arch map"; then |
32 |
|
|
echo "<li><a href='$file.html'>$file</a> [map]</li>" >&7 |
33 |
|
|
DIR="${dir#/}" |
34 |
|
|
echo "$DIR$file" >>$BASE/.cfmap2html |
35 |
|
|
else |
36 |
|
|
echo "<li><a href='$file'>$file</a> [file]</li>" >&7 |
37 |
|
|
fi |
38 |
|
|
;; |
39 |
|
|
esac |
40 |
|
|
elif [ -d "$file" ]; then |
41 |
|
|
case "$file" in |
42 |
|
|
CVS ) |
43 |
|
|
;; |
44 |
|
|
* ) |
45 |
|
|
echo "<li><a href='$file/'>$file/</a> [dir]</li>" >&7 |
46 |
|
|
;; |
47 |
|
|
esac |
48 |
|
|
fi |
49 |
|
|
done |
50 |
|
|
echo "</ul></body></html>" >&7 |
51 |
|
|
} 7>index.html |
52 |
|
|
) |
53 |
|
|
done |
54 |
|
|
|
55 |
|
|
<.cfmap2html xargs cfmap2html |
56 |
root |
1.2 |
rm -f .cfmap2html |
57 |
|
|
|
58 |
|
|
cfarch2html |
59 |
|
|
|