#!/bin/sh set -u # TODO: # import of images # root directory of the cryptobox development environment ROOT_DIR="$(dirname $(dirname $0))" # retrieve these pages from the wiki PAGES="CryptoBox CryptoBoxDev CryptoBoxKonzept CryptoBoxEn" # the trailing slash is important WIKI_HOST="https://systemausfall.org" WIKI_URL="/wikis/howto/" # the trailing slash is important DEST_PATH="cbox-tree.d/usr/share/doc/cryptobox/html/" TMP_FILE="/tmp/$(basename $0)-$$.out" # the URL of the CGI of the cryptobox (the ampersand must be escaped!) CBOX_CGI='/cryptobox?action=show_doc\&page=' [ ! -e "$DEST_PATH" ] && echo "$DEST_PATH does not exist" && exit 1 for PAGE in $PAGES; do PAGE_SRC="$WIKI_HOST$WIKI_URL$PAGE" echo "Importing $PAGE ..." [ -e "$TMP_FILE" ] && rm "$TMP_FILE" # download the page echo " downloading the page ..." wget -q -O "$TMP_FILE" "$PAGE_SRC" || { echo "Downloading ($PAGE_SRC) failed!"; exit 1; } echo " removing header and footer ..." # break lines before start of content sed -i 's#
]* id="content" [^>]*>#_END_OF_HEADER_\n#' "$TMP_FILE" sed -i 's#