1 | #!/bin/bash |
1 | #!/bin/bash |
|
|
2 | |
|
|
3 | # cfupdate - convert a crossfire maps hierarchy to html |
|
|
4 | # Copyright (C) 2005 Marc Lehmann <gvpe@schmorp.de> |
|
|
5 | # |
|
|
6 | # CFUPDATE is free software; you can redistribute it and/or modify |
|
|
7 | # it under the terms of the GNU General Public License as published by |
|
|
8 | # the Free Software Foundation; either version 2 of the License, or |
|
|
9 | # (at your option) any later version. |
|
|
10 | # |
|
|
11 | # This program is distributed in the hope that it will be useful, |
|
|
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
|
14 | # GNU General Public License for more details. |
|
|
15 | # |
|
|
16 | # You should have received a copy of the GNU General Public License |
|
|
17 | # along with gvpe; if not, write to the Free Software |
|
|
18 | # Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
2 | |
19 | |
3 | umask 022 |
20 | umask 022 |
4 | |
21 | |
5 | PATH=/root/src/crossfire:$PATH |
22 | PATH=/root/src/crossfire:$PATH |
6 | BASE=/var/www/cfmaps.schmorp.de |
23 | BASE=/var/www/cfmaps.schmorp.de |
… | |
… | |
17 | find . -name CVS -prune -o -type d -printf "%P/\n" | while read dir; do |
34 | find . -name CVS -prune -o -type d -printf "%P/\n" | while read dir; do |
18 | ( |
35 | ( |
19 | export dir |
36 | export dir |
20 | cd "./$dir" || exit 68 |
37 | cd "./$dir" || exit 68 |
21 | { |
38 | { |
22 | echo "<html><head><title>Crossfire Maps Directory \"$dir\"</title></head><body><h1>Crossfire Maps Directory \"$dir\"</h1><h2>This Directory</h2><ul>" >&7 |
39 | echo "<html><head><title>Crossfire Maps Directory \"$dir\"</title></head><body><h1>Crossfire Maps Directory \"$dir\"</h1><ul>" >&7 |
23 | echo "<li><a href='..'><parent></a></li>" >&7 |
40 | echo "<li><a href='..'><parent></a></li></ul><h2>This Directory</h2><ul>" >&7 |
24 | for file in *; do |
41 | for file in *; do |
25 | if [ -f "$file" ]; then |
42 | if [ -f "$file" ]; then |
26 | case "$file" in |
43 | case "$file" in |
27 | *.pst | *.jpg | *.png | *.html | *.html.gz | *~ ) |
44 | *.pst | *.jpg | *.png | *.html | *.html.gz | *~ ) |
28 | ;; |
45 | ;; |