Commit | Line | Data |
---|---|---|
58266dd3 | 1 | #!/bin/sh -x |
0873522c FB |
2 | |
3 | type=$1 | |
4 | owner=$2 | |
5 | url=$3 | |
6 | apache_group=www-data | |
7 | rootpath=/home/x2003bruneau/public_html/ | |
8 | templatepath=dotclear | |
9 | baseurl=/~x2003bruneau | |
10 | serviceurl="http://murphy.m4x.org/~x2003bruneau/dotclear2/xorgservice/createBlog" | |
11 | ||
12 | die() { | |
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 | ||
21 | cd $owner | |
58266dd3 | 22 | for 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" |
24 | done | |
58266dd3 | 25 | mkdir -p "$rootpath/$templatepath/public/$owner" |
0873522c FB |
26 | |
27 | ( cat <<EOF | |
58266dd3 | 28 | RewriteEngine On |
0873522c | 29 | RewriteBase $baseurl/$owner |
58266dd3 FB |
30 | RewriteCond %{REQUEST_FILENAME} !-f |
31 | RewriteCond %{REQUEST_FILENAME} !-d | |
32 | RewriteRule (.*) index.php/\$1 | |
33 | RewriteRule ^index.php\$ index.php/ | |
0873522c FB |
34 | SetEnv DC_BLOG_ID $owner |
35 | EOF | |
36 | ) > .htaccess |