Integration of xorg Auth widget in nav-bar
[dotclear.git] / createBlog.sh
CommitLineData
0873522c
FB
1#!/bin/sh
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
17( wget "$serviceurl?owner=$owner&type=$type&url=$3" -O - 2> /dev/null | grep 'blog created' ) || die "Blog creating failed"
18
19( cd $rootpath && mkdir $owner ) || die "Can't create the repository for the blog"
20
21cd $owner
22for i in admin db inc index.php locales plugins themes ; do
23 ln -s $rootpath/$templatepath/$i || die "Can't add path to $i"
24done
25mkdir public && chmod a+rwx public
26
27( cat <<EOF
28RewriteEngine On
29RewriteBase $baseurl/$owner
30RewriteCond %{REQUEST_FILENAME} !-f
31RewriteCond %{REQUEST_FILENAME} !-d
32RewriteRule (.*) index.php/\$
33RewriteRule ^index.php\$ index.php/
34SetEnv DC_BLOG_ID $owner
35EOF
36) > .htaccess