cryptonas-branches/v0.2.1/etc-defaults.d/userdocexport.sh

23 lines
800 B
Bash
Raw Normal View History

2005-10-17 13:59:08 +02:00
#!/bin/sh
set -u
## diese Seiten aus dem Wiki ziehen und entschlacken
SITES="CryptoBox CryptoBoxDev"
DEST_PATH="cryptobox.conf.d/var/www/userdoc/"
[ ! -e $DEST_PATH ] && echo "$DEST_PATH does not exist" && exit
for SITE in $SITES; do
SITE_SRC="https://systemausfall.org/wikis/howto/$SITE"
SITE_TMP="/tmp/$SITE"
SITE_DEST="${DEST_PATH}${SITE}.html"
[ -e $SITE_TMP ] && echo "$SITE_TMP exists" && exit
wget -O $SITE_TMP $SITE_SRC || exit
sed -n "1,/\<title\>/p" $SITE_TMP > $SITE_DEST
echo "<link rel="stylesheet" type="text/css" charset="utf-8" media="all" href="../cryptobox.css">" >> $SITE_DEST
echo -e "</head>\n<body>\n" >> $SITE_DEST
sed -n /\<\!--\ start\ page\ --\>/,/\<\!--\ end\ page\ --\>/p $SITE_TMP >> $SITE_DEST
echo -e "</body>\n</html>\n" >> $SITE_DEST
rm $SITE_TMP
done