source: MondoRescue/trunk/tools/livwww@ 932

Last change on this file since 932 was 932, checked in by Bruno Cornec, 18 years ago

merge -r913:931 $SVN_M/branches/stable

  • Property svn:executable set to *
File size: 2.1 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
33dname=`dirname $0`
34prem=`echo $dname |cut -c1`
35if [ ${prem} == "/" ]; then
36 export TOOLHOME=$dname
37else
38 export TOOLHOME=${PWD}/$dname
39fi
40
41. $TOOLHOME/common-env
42. $TOOLHOME/svn-env
43. $TOOLHOME/ftp-env
44
45# To be safe for SVN commands
46cd ${TOOLHOME}/..
47
48if [ $force -eq 1 ]; then
49 echo "Purging $LOCALDIR"
50 rm -rf $LOCALDIR/* $LOCALDIR/.??*
51fi
52
53svn export $optsvn ${TOOLHOME}/../website $LOCALDIR
54
55if [ $force -eq 1 ]; then
56 echo "Purging $LOCALDOC"
57 rm -rf $LOCALDOC/* $LOCALDOC/.??*
58fi
59
60svn export $optsvn ${TOOLHOME}/../mondo-doc $LOCALDOC
61
62#
63# Version handling
64#
65$TOOLHOME/expandver $LOCALDIR/top.shtml $LOCALDOC/mondorescue-howto.sgml $LOCALDOC/*.8
66
67if [ $nodoc -eq 0 ]; then
68 cd $LOCALDOC
69 make -f Makefile.howto
70 make -f Makefile.man
71 mkdir -p $LOCALDIR/docs
72 mv $LOCALDOC/* $LOCALDIR/docs
73 #
74 # Man pages corrections
75 #
76 perl -pi -e 's~/man8/~/docs/~g' $LOCALDIR/docs/*.8.html
77 perl -pi -e 's~<A HREF[=./A-z0-9"]*/man1/[^<]*>([A-z0-9]*)</A>~$1~g' $LOCALDIR/docs/*.8.html
78 perl -pi -e 's~/index.html~/index.shtml~' $LOCALDIR/docs/*.8.html
79fi
80find $LOCALDIR -type d | xargs chmod 755
81find $LOCALDIR -type f | xargs chmod 644
82
83cd $LOCALDIR
84#
85# Some links for the Web site
86#
87ln -sf /var/www/html/mediawiki .
88ln -sf /var/www/html/admin .
89
90# Compute News
91$TOOLHOME/mknewshtml.pl $LOCALDIR
92
93if [ _"$1" == _"" ]; then
94 exit 0
95else
96 if [ _"$1" == _"test" ]; then
97 DESTDIR=$TESTDIR
98 else
99 DESTDIR=$MONDODIR
100 fi
101 echo "Delivering to $DESTDIR on ${DESTMACH}"
102fi
103tar cfz /tmp/mondo-www.tgz .
104scp /tmp/mondo-www.tgz ${DESTUSER}@${DESTMACH}:/tmp
105rm -f /tmp/mondo-www.tgz
106ssh ${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.