images moved to /var/www/cryptobox-img

doc pages served by the CGI again (as until rev 164)
URLs of images in stylesheet are absolute now
moved 'partition_info' layout to stylesheet file
CGI: file handling now done with perl instead of shell utilities
CGI: removed warning for 'crypto not mounted' after 'poweroff' or 'reboot'
CGI: warning, if unmount-crypto failed
CGI: warning, if configuration of any value failed silently
texts for 'ConfigTimeOutFailed', 'ConfigLanguageFailed' and 'ConfigIPFailed' added to language file
cbox-manage.sh: syntax info updated
cbox-manage.sh: action 'crypto-(u)mount' renamed to 'crypto-up/down'
This commit is contained in:
lars 2005-09-01 15:00:54 +00:00
parent 66c5d1955e
commit 16b5e2f07b
18 changed files with 131 additions and 79 deletions

View file

@ -1,9 +1,6 @@
#!/bin/sh
set -u
# TODO:
# import of images
# root directory of the cryptobox development environment
ROOT_DIR="$(dirname $(dirname $0))"
@ -18,7 +15,10 @@ WIKI_URL="/wikis/howto/"
HEADER_FILE="$ROOT_DIR/tools/doc_header.inc"
FOOTER_FILE="$ROOT_DIR/tools/doc_footer.inc"
CBOX_CGI="/cryptobox?action=doc\&page="
DEST_DIR="$ROOT_DIR/cbox-tree.d/usr/share/doc/cryptobox/html"
IMAGE_DIR="$ROOT_DIR/cbox-tree.d/var/www/cryptobox-img"
TMP_DIR=/tmp/$(basename $0)-$$.d
[ ! -e "$DEST_DIR" ] && echo "$DEST_DIR does not exist" && exit 1
@ -40,11 +40,11 @@ for PAGE in $PAGES; do
# remove all lines before and after "body"
sed -i '1,/_END_OF_HEADER_/d; /_START_OF_FOOTER_/,$d' "$TMP_FILE"
echo " adding header and footer ..."
[ -e "${TMP_FILE}.0" ] && rm "${TMP_FILE}.0"
mv "$TMP_FILE" "${TMP_FILE}.0"
cat "$HEADER_FILE" "${TMP_FILE}.0" "$FOOTER_FILE" >"$TMP_FILE"
rm "${TMP_FILE}.0"
#echo " adding header and footer ..."
#[ -e "${TMP_FILE}.0" ] && rm "${TMP_FILE}.0"
#mv "$TMP_FILE" "${TMP_FILE}.0"
#cat "$HEADER_FILE" "${TMP_FILE}.0" "$FOOTER_FILE" >"$TMP_FILE"
#rm "${TMP_FILE}.0"
echo " downloading requisites ..."
wget --quiet --ignore-tags=a --no-clobber --page-requisites --convert-links --no-parent --no-directories --base="$WIKI_HOST$WIKI_URL" --directory-prefix="$TMP_DIR" --html-extension --force-html --input-file="$TMP_FILE" || { echo "Downloading requisites for ($PAGE_SRC) failed!"; exit 1; }
@ -52,17 +52,16 @@ for PAGE in $PAGES; do
echo " adjusting links for requisites ..."
find "$TMP_DIR" -type f | grep -v '\.html$' | while read a
do fname=$(basename "$a")
sed -i "s#=\"[^\"]*/$fname\"#=\"$fname\"#g" "$TMP_FILE"
sed -i "s#=\"[^\"]*/$fname\"#=\"/cryptobox-img/$fname\"#g" "$TMP_FILE"
done
# TODO: replace wiki-links by references to the cbox-cgi
# check if wiki-links are absolute!
echo " adjusting wiki links ..."
# add the ".html" suffix and remove absolute path
sed -i "s#=\"$WIKI_URL\([^\.]*\)\"#=\"\1.html\"#g" "$TMP_FILE"
# redirect wiki links to cryptobox cgi
sed -i "s#=\"$WIKI_URL\([^\.]*\)\"#=\"$CBOX_CGI\1\"#g" "$TMP_FILE"
echo " finished!"
done
cp "$TMP_DIR"/* "$DEST_DIR"
rm -r "$TMP_DIR"
mv "$TMP_DIR"/*.html "$DEST_DIR"
mv "$TMP_DIR"/* "$IMAGE_DIR"
rmdir "$TMP_DIR"