source: MondoRescue/branches/stable/tools/livwww @ 400

Last change on this file since 400 was 400, checked in by bcornec, 14 years ago

Improvements for man page generation (web links now correct)

  • Property svn:executable set to *
File size: 1.4 KB
Line 
1#!/bin/bash
2#
3# $Id$
4#
5# Delivery of the Web site in a DocumentRoot
6#
7#
8# Please replace with your destination
9#
10LOCALDIR=/var/www/html/mondo
11DESTUSER=apache
12MONDODIR=/mondo/www/html/mondo
13TESTDIR=/mondo/www/html/test
14
15/sbin/ifconfig | grep -q 10.3 2>&1 > /dev/null
16if [ $? = 0 ]; then
17    DESTMACH=mondo.hpintelco.org
18else
19    DESTMACH=www1.mondorescue.org
20fi
21
22dname=`dirname $0`
23prem=`echo $dname |cut -c1`
24if [ ${prem} == "/" ]; then
25        export TOOLHOME=$dname
26else
27        export TOOLHOME=${PWD}/$dname
28fi
29
30. $TOOLHOME/common-env
31
32rm -rf $LOCALDIR
33cp -a ${BASE}/svn/${VER}/website $LOCALDIR
34(cd ${BASE}/svn/${VER}/documentation ; make)
35mkdir -p $LOCALDIR/docs
36cp -a ${BASE}/svn/${VER}/documentation/* $LOCALDIR/docs
37#
38# Man pages corrections
39#
40perl -pi -e 's~/man8/~/docs/~g' $LOCALDIR/docs/*.8.html
41perl -pi -e 's~<A HREF[=./A-z0-9"]*/man1/[^<]*>([A-z0-9]*)</A>~$1~g' $LOCALDIR/docs/*.8.html
42perl -pi -e 's~/index.html~/index.shtml~' $LOCALDIR/docs/*.8.html
43find $LOCALDIR -type d | xargs chmod 755
44find $LOCALDIR -type f | xargs chmod 644
45cd $LOCALDIR
46if [ _"$1" == _"" ]; then
47        exit 0
48else
49    if [ _"$1" == _"test" ]; then
50        DESTDIR=$TESTDIR
51    else
52        DESTDIR=$MONDODIR
53    fi
54fi
55tar cfz /tmp/mondo-www.tgz .
56ssh ${DESTUSER}@${DESTMACH} "rm -rf ${DESTDIR} ; mkdir ${DESTDIR}"
57scp /tmp/mondo-www.tgz ${DESTUSER}@${DESTMACH}:/tmp
58rm -f /tmp/mondo-www.tgz
59ssh ${DESTUSER}@${DESTMACH} "cd ${DESTDIR} ; tar xfz /tmp/mondo-www.tgz"
Note: See TracBrowser for help on using the repository browser.