From 449c83c3f394e8c53161001e881effd8e7fd7b06 Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Fri, 27 Mar 2015 21:02:59 +0100 Subject: [PATCH] Update install --- scripts/install | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index d40769d..15817be 100644 --- a/scripts/install +++ b/scripts/install @@ -15,8 +15,12 @@ if [[ ! $? -eq 0 ]]; then exit 1 fi +# Vérifie la présence du / en début de path +if [ $(echo $path | cut -c1) != "/" ]; then + path="/$path" +fi # Vérifie l'absence du / en fin de path -path=$(echo "$path" | sed 's@/$@@') +pathRslash=$(echo "$path" | sed 's@/$@@') # Check domain/path availability sudo yunohost app checkurl $domain$path -a $app @@ -68,7 +72,7 @@ sudo apt-get install perlmagick -qy ## Copie et configuration du fichier de conf. sudo cp ../conf/lutim.conf.template "$final_path/lutim.conf" sudo sed -i "s@__DOMAIN__@$domain@g" "$final_path/lutim.conf" -sudo sed -i "s@__PATH__@$path@g" "$final_path/lutim.conf" +sudo sed -i "s@__PATH__@$pathRslash@g" "$final_path/lutim.conf" sudo sed -i "s@__PORT__@$port@g" "$final_path/lutim.conf" if [ "$always_encrypt" = "No" ]; then always_encrypt=0 @@ -101,14 +105,14 @@ sudo update-rc.d lutim defaults # sudo update-rc.d -f lutim remove # Change variables in nginx configuration -sudo sed -i "s@__PATH__@$path@g" /etc/nginx/conf.d/$domain.d/$app.conf +sudo sed -i "s@__PATH__@$pathRslash@g" /etc/nginx/conf.d/$domain.d/$app.conf sudo sed -i "s@__PORT__@$port@g" /etc/nginx/conf.d/$domain.d/$app.conf # Make app public or private sudo yunohost app setting $app skipped_uris -v "/" if [ "$is_public" = "No" ]; then # Si l'app est privée, seul le visionnage des images reste public - sudo yunohost app setting $app protected_regex -v "$path/stats$","$path/manifest.webapp$","$path/$","$path/d/.*$","$path/m/.*$" + sudo yunohost app setting $app protected_regex -v "$pathRslash/stats$","$pathRslash/manifest.webapp$","$pathRslash/$","$pathRslash/d/.*$","$pathRslash/m/.*$" fi # Making log symbolic link to /var/log