summaryrefslogtreecommitdiff
path: root/install/install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'install/install.sh')
-rwxr-xr-xinstall/install.sh11
1 files changed, 10 insertions, 1 deletions
diff --git a/install/install.sh b/install/install.sh
index 7358ee747..049a8a34a 100755
--- a/install/install.sh
+++ b/install/install.sh
@@ -41,7 +41,10 @@ UWSGI_PORT=${UWSGI_PORT-8891}
NGINX_PORT=${NGINX_PORT-80}
# don't forget the trailing slash
-INSTALL_PREFIX=/srv/
+INSTALL_PREFIX=${INSTALL_PREFIX-/srv/}
+if ! echo "$INSTALL_PREFIX" | grep -qs '/$'; then
+ INSTALL_PREFIX="$INSTALL_PREFIX/"
+fi
# if a virtualenv is used put the full path of the python to use
PYTHON=python
@@ -235,8 +238,11 @@ $PYTHON ./manage.py migrate --fake 2> /dev/null > /dev/null
echo '* uwsgi configuration'
+# NOTE: Replacing #INSTALL_PREFIX#/ is done on purpose, since we
+# ensured that variable has a trailing slash.
sed -s "s|#APP_NAME#|$APP_NAME|g;\
s|#DB_NAME#|$DB_NAME|g;\
+ s|#INSTALL_PREFIX#/|$INSTALL_PREFIX|g;\
s|#URL#|$URL|g;\
s|#UWSGI_PORT#|$UWSGI_PORT|g;" $CDIR'/uwsgi.ini.template' > \
$INSTALL_PATH'/conf/uwsgi.ini'
@@ -254,11 +260,14 @@ service uwsgi restart
echo '* nginx configuration'
+# NOTE: Replacing #INSTALL_PREFIX#/ is done on purpose, since we
+# ensured that variable has a trailing slash.
sed -s "s|#APP_NAME#|$APP_NAME|g;\
s|#UWSGI_PORT#|$UWSGI_PORT|g;\
s|#DB_NAME#|$DB_NAME|g;\
s|#DATE#|$DATE|g;\
s|#NGINX_PORT#|$NGINX_PORT|g;\
+ s|#INSTALL_PREFIX#/|$INSTALL_PREFIX|g;\
s|#URL#|$URL|g;" $CDIR'/nginx.conf.template' > \
$INSTALL_PATH'/conf/nginx.conf'
ln -s $INSTALL_PATH'/conf/nginx.conf' \