From 7c6e3b79ecb7157c04eecdb0171f2851d2e75f1d Mon Sep 17 00:00:00 2001 From: Moul Date: Tue, 14 Jun 2016 12:55:55 +0200 Subject: [PATCH] [enh] scripts: small fixes. - ssowatconf is no more necessary at the end of the install script. --- scripts/install | 13 +++++-------- scripts/upgrade | 8 ++------ 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/scripts/install b/scripts/install index 43fb38c..49ef2e7 100644 --- a/scripts/install +++ b/scripts/install @@ -22,8 +22,7 @@ fi # Check user sudo yunohost user list --json | grep -q "\"username\": \"$admin\"" if [[ ! $? -eq 0 ]]; then - echo "Wrong user" - exit 1 + echo "Wrong user" && exit 1 fi # Save app settings @@ -60,7 +59,7 @@ sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf #temporary set public accessible sudo yunohost app setting $app unprotected_uris -v "/" -# Restart services +# Reload services sudo service nginx reload sudo yunohost app ssowatconf @@ -92,8 +91,7 @@ sudo rm -f $final_path/install.php sudo sed -i "/#pluxml_hosts/d" /etc/hosts # If app is private, remove url to SSOWat conf from skipped_uris -if [ "$is_public" = "No" ]; -then +if [ "$is_public" = "No" ]; then sudo yunohost app setting $app unprotected_uris -d fi @@ -101,8 +99,7 @@ fi sudo yunohost app addaccess $app -u $admin #allow only allowed users to access admin panel -sudo yunohost app setting pluxml protected_uris -v "/core/admin/" +sudo yunohost app setting $app protected_uris -v "/core/admin/" -# Restart services +# Reload nginx service sudo service nginx reload -sudo yunohost app ssowatconf diff --git a/scripts/upgrade b/scripts/upgrade index 706a86d..8fe4d0b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -8,7 +8,6 @@ path=$(sudo yunohost app setting $app path) admin=$(sudo yunohost app setting $app admin) is_public=$(sudo yunohost app setting $app is_public) - # Remove trailing "/" for next commands path=${path%/} @@ -24,18 +23,15 @@ sudo chown -R www-data: $final_path/data sudo find $final_path -type f | xargs sudo chmod 644 sudo find $final_path -type d | xargs sudo chmod 755 - #configure nginx settings sudo sed -i "s@YNH_EXAMPLE_PATH@$path@g" ../conf/nginx.conf sudo sed -i "s@YNH_EXAMPLE_ALIAS@$final_path@g" ../conf/nginx.conf sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf # If app is public, add url to SSOWat conf as skipped_uris -if [ "$is_public" = "Yes" ]; -then +if [ "$is_public" = "Yes" ]; then sudo yunohost app setting $app unprotected_uris -v "/" fi -# Restart services +# Reload nginx service sudo service nginx reload -sudo yunohost app ssowatconf