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

Last change on this file since 417 was 417, checked in by bcornec, 15 years ago

Adds a warning on old webisite around paypal

  • Property svn:executable set to *
File size: 1.9 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#
10
11
12LOCALDIR=/var/www/html/mondo
13LOCALDOC=/var/www/html/mondo-doc
14DESTUSER=apache
15MONDODIR=/mondo/www/html/mondo
16TESTDIR=/mondo/www/html/test
17
18force=0
19
20if [ "$1" = "-f" ]; then
21        force=1
22        optsvn=""
23        shift
24else
25        optsvn="--force"
26fi
27
28/sbin/ifconfig | grep -q 10.3 2>&1 > /dev/null
29if [ $? = 0 ]; then
30    DESTMACH=mondo.hpintelco.org
31else
32    DESTMACH=www1.mondorescue.org
33fi
34
35dname=`dirname $0`
36prem=`echo $dname |cut -c1`
37if [ ${prem} == "/" ]; then
38        export TOOLHOME=$dname
39else
40        export TOOLHOME=${PWD}/$dname
41fi
42
43. $TOOLHOME/common-env
44
45cd ${BASE}/svn
46
47if [ $force -eq 1 ]; then
48    echo "Purging $LOCALDIR"
49    rm -rf $LOCALDIR
50fi
51
52svn export $optsvn ${VER}/website $LOCALDIR
53
54if [ $force -eq 1 ]; then
55    echo "Purging $LOCALDOC"
56    rm -rf $LOCALDOC
57fi
58
59svn export $optsvn ${VER}/documentation $LOCALDOC
60
61#
62# Version handling
63#
64$TOOLHOME/expandver $LOCALDIR/top.shtml $LOCALDOC/mondorescue-howto.sgml $LOCALDOC/*.8
65
66cd $LOCALDOC
67make -f Makefile.howto
68make -f Makefile.man
69mv $LOCALDOC $LOCALDIR/docs
70#
71# Man pages corrections
72#
73perl -pi -e 's~/man8/~/docs/~g' $LOCALDIR/docs/*.8.html
74perl -pi -e 's~<A HREF[=./A-z0-9"]*/man1/[^<]*>([A-z0-9]*)</A>~$1~g' $LOCALDIR/docs/*.8.html
75perl -pi -e 's~/index.html~/index.shtml~' $LOCALDIR/docs/*.8.html
76find $LOCALDIR -type d | xargs chmod 755
77find $LOCALDIR -type f | xargs chmod 644
78
79cd $LOCALDIR
80#
81# Some links for the Web site
82#
83ln -sf /var/www/html/mediawiki .
84ln -sf /var/www/html/admin .
85
86if [ _"$1" == _"" ]; then
87        exit 0
88else
89    if [ _"$1" == _"test" ]; then
90        DESTDIR=$TESTDIR
91    else
92        DESTDIR=$MONDODIR
93    fi
94fi
95tar cfz /tmp/mondo-www.tgz .
96ssh ${DESTUSER}@${DESTMACH} "rm -rf ${DESTDIR} ; mkdir ${DESTDIR}"
97scp /tmp/mondo-www.tgz ${DESTUSER}@${DESTMACH}:/tmp
98rm -f /tmp/mondo-www.tgz
99ssh ${DESTUSER}@${DESTMACH} "cd ${DESTDIR} ; tar xfz /tmp/mondo-www.tgz"
Note: See TracBrowser for help on using the repository browser.