Improve the createBlog script.
authorRaphaël Barrois <raphael.barrois@polytechnique.org>
Fri, 8 Apr 2011 23:11:50 +0000 (01:11 +0200)
committerRaphaël Barrois <raphael.barrois@polytechnique.org>
Fri, 8 Apr 2011 23:11:50 +0000 (01:11 +0200)
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
createBlog-dev.sh
createBlog.sh

index a1ecff6..200ecb0 100755 (executable)
@@ -108,13 +108,15 @@ apache_group=www-data
 rootpath=${HOME}/dev/blogs/
 templatepath=dotclear
 
-serviceurl="http://dev.blog-x.org/dotclear/xorgservice/createBlog"
+serviceurl="http://dev.blog-x.org/default/xorgservice/createBlog"
 
-( wget "$serviceurl?owner=$OWNER&type=$TYPE&url=$URL&baseurl=${BASEURL}" -O - 2> /dev/null | grep 'blog created' ) || die "Blog creation failed"
+CALLED="$serviceurl?owner=${OWNER}&type=${TYPE}&url=${URL}&baseurl=${BASEURL}"
+echo "Calling $CALLED"
+( wget "$CALLED" -O - 2> /dev/null | grep 'blog created' ) || die "Blog creation failed"
 
-( cd $rootpath && mkdir $OWNER ) || die "Can't create the repository for the blog ($rootpath/$OWNER)"
+( cd $rootpath && mkdir -p $OWNER ) || die "Can't create the repository for the blog ($rootpath/$OWNER)"
 
-cd $OWNER
+cd $rootpath/$OWNER
 for i in admin db inc index.php locales plugins themes; do
   ln -s $rootpath/$templatepath/$i || die "Can't add path to $i"
 done
index 36ac599..3d97a77 100755 (executable)
@@ -115,11 +115,13 @@ templatepath=dotclear
 
 serviceurl="http://blog.polytechnique.org/xorgservice/createBlog"
 
-( wget "$serviceurl?owner=$OWNER&type=$TYPE&url=$URL&baseurl=${BASEURL}" -O - 2> /dev/null | grep 'blog created' ) || die "Blog creation failed"
+CALLED="$serviceurl?owner=${OWNER}&type=${TYPE}&url=${URL}&baseurl=${BASEURL}"
+echo "Calling $CALLED"
+( wget "$CALLED" -O - 2> /dev/null | grep 'blog created' ) || die "Blog creation failed"
 
-( cd $rootpath && mkdir $OWNER ) || die "Can't create the repository for the blog ($rootpath/$OWNER)"
+( cd $rootpath && mkdir -p $OWNER ) || die "Can't create the repository for the blog ($rootpath/$OWNER)"
 
-cd $OWNER
+cd $rootpath/$OWNER
 for i in admin db inc index.php locales plugins themes; do
   ln -s $rootpath/$templatepath/$i || die "Can't add path to $i"
 done