1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
#! /bin/bash
SCRIPTDIR=`dirname $0`
ADVENEHOME=`dirname $SCRIPTDIR`
output=${ADVENEHOME}/share/web/user.html
shortcuts=${ADVENEHOME}/share/web/shortcuts.html
if [ ! -d "${ADVENEHOME}/doc" ]
then
echo "Unable to find the Advene directory"
exit 1
fi
# Shortcuts
wget --quiet 'http://liris.cnrs.fr/advene/wiki/index.php/AdveneShortcuts' -O $shortcuts
if [ $? == 0 ]
then
perl -pi -e 's/<(style|link|script).+?<\/\1>//; s/<span class=.editsection.+?<\/span>//; s/<div id=.jump-to-nav.+?<\/div>//; s/.+siteSub.+//; s!<head>!<head><link rel="stylesheet" type="text/css" href="http://liris.cnrs.fr/advene/advene.css" />!; exit(0) if /Retrieved/' $shortcuts
echo "Shortcuts help updated in $shortcuts"
else
echo "Wget error. $shortcuts is now corrupted."
fi
|