|
|
|
@ -29,18 +29,20 @@ WIKI_HOST="https://systemausfall.org"
|
|
|
|
|
# the trailing slash is important
|
|
|
|
|
WIKI_URL=/trac/cryptobox/wiki/
|
|
|
|
|
|
|
|
|
|
CBOX_CGI="/cryptobox?action=doc\&page="
|
|
|
|
|
CBOX_CGI="?action=doc\&page="
|
|
|
|
|
|
|
|
|
|
LANGUAGES="de en"
|
|
|
|
|
|
|
|
|
|
DEST_DIR="$ROOT_DIR/cbox-tree.d/usr/share/doc/cryptobox/html"
|
|
|
|
|
OFFLINE_DIR="$ROOT_DIR/live-cd-tree.d/_offline/doc"
|
|
|
|
|
DEST_DIR="$ROOT_DIR/doc/html"
|
|
|
|
|
OFFLINE_DIR="$ROOT_DIR/../live-cd/live-cd-tree.d/_offline/doc"
|
|
|
|
|
IMAGE_DIR="$ROOT_DIR/cbox-tree.d/var/www/cryptobox-misc"
|
|
|
|
|
TMP_DIR=/tmp/$(basename $0)-$$.d
|
|
|
|
|
|
|
|
|
|
HEADER_FILE=doc_header.inc
|
|
|
|
|
FOOTER_FILE=doc_footer.inc
|
|
|
|
|
|
|
|
|
|
WGET_OPTS="--quiet --no-check-certificate"
|
|
|
|
|
|
|
|
|
|
[ ! -e "$DEST_DIR" ] && echo "$DEST_DIR does not exist" && exit 1
|
|
|
|
|
|
|
|
|
|
for LANG in $LANGUAGES; do
|
|
|
|
@ -53,14 +55,14 @@ for LANG in $LANGUAGES; do
|
|
|
|
|
mkdir -p "$TMP_DIR"
|
|
|
|
|
|
|
|
|
|
echo " downloading the page ..."
|
|
|
|
|
wget --quiet --output-document="$TMP_FILE" "$PAGE_SRC" || { echo "Downloading ($PAGE_SRC) failed!"; exit 1; }
|
|
|
|
|
wget $WGET_OPTS --output-document="$TMP_FILE" "$PAGE_SRC" || { echo "Downloading ($PAGE_SRC) failed!"; exit 1; }
|
|
|
|
|
|
|
|
|
|
# check if this moin page exists (by looking for the template selection)
|
|
|
|
|
# check if this page exists
|
|
|
|
|
if grep -q "^describe $PAGE/$LANG here$" "$TMP_FILE"
|
|
|
|
|
then rm "$TMP_FILE"
|
|
|
|
|
PAGE_SRC=$(dirname $PAGE_SRC)
|
|
|
|
|
echo " trying to download default language page instead"
|
|
|
|
|
wget --quiet --output-document="$TMP_FILE" "$PAGE_SRC" || { echo "Downloading ($PAGE_SRC) failed!" >&2; exit 1; }
|
|
|
|
|
wget $WGET_OPTS --output-document="$TMP_FILE" "$PAGE_SRC" || { echo "Downloading ($PAGE_SRC) failed!" >&2; exit 1; }
|
|
|
|
|
# check, if there is even no default page
|
|
|
|
|
grep -q "^describe $PAGE/$LANG here$" "$TMP_FILE" && echo "This page ($PAGE_SRC) was not found!" >&2 && exit 1
|
|
|
|
|
fi
|
|
|
|
@ -121,7 +123,7 @@ for LANG in $LANGUAGES; do
|
|
|
|
|
|
|
|
|
|
# some last changes to the dynamic pages (must be done _after_ the static pages)
|
|
|
|
|
# add weblang for current language to query string
|
|
|
|
|
sed -i "s#=\"$CBOX_CGI\(.*\)\"#=\"$CBOX_CGI\1\&weblang=$LANG\"#g" "$TMP_FILE"
|
|
|
|
|
sed -i "s;=\"$CBOX_CGI\([^#\"]*\)\([#\"]\);=\"$CBOX_CGI\1\&weblang=$LANG\2;g" "$TMP_FILE"
|
|
|
|
|
# move cgi-doc
|
|
|
|
|
mv "$TMP_FILE" "$DEST_DIR/$LANG"
|
|
|
|
|
|
|
|
|
|