Some fixes on installation scripts.
[dotclear.git] / createBlog.sh
CommitLineData
58266dd3 1#!/bin/sh -x
0873522c
FB
2
3type=$1
4owner=$2
5url=$3
6apache_group=www-data
7rootpath=/home/x2003bruneau/public_html/
8templatepath=dotclear
9baseurl=/~x2003bruneau
10serviceurl="http://murphy.m4x.org/~x2003bruneau/dotclear2/xorgservice/createBlog"
11
12die() {
13 echo $1
14 exit 1
15}
16
58266dd3 17( wget "$serviceurl?owner=$owner&type=$type&url=$3" -O - 2> /dev/null | grep 'blog created' ) || die "Blog creation failed"
0873522c
FB
18
19( cd $rootpath && mkdir $owner ) || die "Can't create the repository for the blog"
20
21cd $owner
58266dd3 22for i in admin db inc index.php locales plugins themes public ; do
0873522c
FB
23 ln -s $rootpath/$templatepath/$i || die "Can't add path to $i"
24done
58266dd3 25mkdir -p "$rootpath/$templatepath/public/$owner"
0873522c
FB
26
27( cat <<EOF
58266dd3 28RewriteEngine On
0873522c 29RewriteBase $baseurl/$owner
58266dd3
FB
30RewriteCond %{REQUEST_FILENAME} !-f
31RewriteCond %{REQUEST_FILENAME} !-d
32RewriteRule (.*) index.php/\$1
33RewriteRule ^index.php\$ index.php/
0873522c
FB
34SetEnv DC_BLOG_ID $owner
35EOF
36) > .htaccess