source: branches/stable/tools/livwww @ 563

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

Attempt to remove all attr entry in mindi spec file which may cause more hassle than anything good

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