projects
/
dotclear.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Support https in blog URLs
[dotclear.git]
/
createBlog.sh
diff --git
a/createBlog.sh
b/createBlog.sh
index
36ac599
..
aaece90
100755
(executable)
--- a/
createBlog.sh
+++ b/
createBlog.sh
@@
-78,7
+78,7
@@
while true ; do
;;
-u)
URL=$2;
;;
-u)
URL=$2;
- if ! echo "${URL}" | grep -E "^http://[^/]+/" > /dev/null; then
+ if ! echo "${URL}" | grep -E "^http
s?
://[^/]+/" > /dev/null; then
echo -e "ERROR: URL must be a full URL, e.g 'http://www.example.org/'\n";
usage 1
fi
echo -e "ERROR: URL must be a full URL, e.g 'http://www.example.org/'\n";
usage 1
fi
@@
-100,7
+100,7
@@
if [[ "x${TYPE}" == "x" || "x${OWNER}" == "x" || "x${URL}" == "x" ]]; then
usage 1
fi
usage 1
fi
-BASEURL=`echo "${URL}" | sed -r 's,http://[^/]+/,/,'`
+BASEURL=`echo "${URL}" | sed -r 's,http
s?
://[^/]+/,/,'`
echo "Creating blog with :
TYPE = ${TYPE}
echo "Creating blog with :
TYPE = ${TYPE}
@@
-115,11
+115,13
@@
templatepath=dotclear
serviceurl="http://blog.polytechnique.org/xorgservice/createBlog"
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
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