From c8b5cd811847539c3eee8671bb5911e155e04d1b Mon Sep 17 00:00:00 2001 From: Moul Date: Wed, 15 Jun 2016 18:17:31 +0000 Subject: [PATCH] [enh] scripts: rename variable final_path to src_path. --- scripts/install | 24 ++++++++++++------------ scripts/upgrade | 20 ++++++++++---------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/scripts/install b/scripts/install index 49ef2e7..701ebfe 100644 --- a/scripts/install +++ b/scripts/install @@ -32,25 +32,25 @@ sudo yunohost app setting $app domain -v "$domain" sudo yunohost app setting $app path -v "$path" #create path for copying -final_path=/var/www/$app -sudo mkdir -p $final_path +src_path=/var/www/$app +sudo mkdir -p $src_path -#copy files to final folder and set permissions -sudo cp -R ../sources/* $final_path/ -sudo find $final_path -type f -name ".htaccess" | xargs sudo rm +#copy files to src folder and set permissions +sudo cp -R ../sources/* $src_path/ +sudo find $src_path -type f -name ".htaccess" | xargs sudo rm #setup permissions -sudo chown -R root: $final_path -sudo chown -R www-data: $final_path/data -sudo chown -R www-data: $final_path/plugins -sudo find $final_path -type f | xargs sudo chmod 644 -sudo find $final_path -type d | xargs sudo chmod 755 +sudo chown -R root: $src_path +sudo chown -R www-data: $src_path/data +sudo chown -R www-data: $src_path/plugins +sudo find $src_path -type f | xargs sudo chmod 644 +sudo find $src_path -type d | xargs sudo chmod 755 #configure nginx settings folder_path=${path%/} sudo sed -i "s@YNH_EXAMPLE_PATH@$path@g" ../conf/nginx.conf # If path is only / (without subfolder), add trailing slash to alias -alias_path=$final_path +alias_path=$src_path [ "$path" == '/' ] && alias_path=$alias_path'/' sudo sed -i "s@YNH_EXAMPLE_ALIAS@$alias_path@g" ../conf/nginx.conf sudo sed -i "s@YNH_EXAMPLE_FOLDER@$folder_path@g" ../conf/nginx.conf @@ -85,7 +85,7 @@ curl -k -X POST \ --data-urlencode "token=$token" \ https://$domain$curl_path/install.php > /dev/null 2>&1 -sudo rm -f $final_path/install.php +sudo rm -f $src_path/install.php #remove domain name from /etc/hosts sudo sed -i "/#pluxml_hosts/d" /etc/hosts diff --git a/scripts/upgrade b/scripts/upgrade index 8fe4d0b..92a19bb 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,20 +12,20 @@ is_public=$(sudo yunohost app setting $app is_public) path=${path%/} # Copy source files -final_path=/var/www/$app -sudo mkdir -p $final_path -sudo cp -a ../sources/* $final_path -sudo find $final_path -type f -name ".htaccess" | xargs sudo rm -sudo rm $final_path/install.php +src_path=/var/www/$app +sudo mkdir -p $src_path +sudo cp -a ../sources/* $src_path +sudo find $src_path -type f -name ".htaccess" | xargs sudo rm +sudo rm $src_path/install.php -sudo chown -R root: $final_path -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 +sudo chown -R root: $src_path +sudo chown -R www-data: $src_path/data +sudo find $src_path -type f | xargs sudo chmod 644 +sudo find $src_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 sed -i "s@YNH_EXAMPLE_ALIAS@$src_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