From 741b369d3546757f00cb2cada2ccdcfe04ccfd23 Mon Sep 17 00:00:00 2001 From: Alexis Gavoty Date: Sun, 20 Jul 2014 14:14:15 +0200 Subject: [PATCH] [fix] Handle path correctly + syntax fixes --- scripts/install | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 59bc2b2..a4e256d 100644 --- a/scripts/install +++ b/scripts/install @@ -11,6 +11,9 @@ if [[ ! $? -eq 0 ]]; then exit 1 fi +# Remove trailing "/" for next commands +path=${path%/} + # Generate random password db_pwd=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d '[A-Za-z0-9]' | sed -n 's/\(.\{24\}\).*/\1/p') @@ -55,16 +58,16 @@ sudo chown -R www-data: $final_path # Modify Nginx configuration file and copy it to Nginx conf directory sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf* sed -i "s@ALIASTOCHANGE@$final_path/@g" ../conf/nginx.conf* -if [ $path != "/" ]; +if [ "$path" = "" ]; then - sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/etherpadlite.conf -else sudo cp ../conf/nginx.conf-nosub /etc/nginx/conf.d/$domain.d/etherpadlite.conf +else + sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/etherpadlite.conf fi # Reload Nginx and regenerate SSOwat conf sudo service nginx reload -if [ $is_public = "Yes" ]; +if [ "$is_public" = "Yes" ]; then sudo yunohost app setting etherpadlite skipped_uris -v "/" fi