From e2bc63b1b5dac573bf2bb3ce128168aede59a56a Mon Sep 17 00:00:00 2001 From: magikcypress Date: Sun, 26 Mar 2017 00:58:09 +0100 Subject: [PATCH] On supprime l'argument dans la fonction SETUP_SOURCE --- scripts/.fonctions | 14 +++++++------- scripts/install | 2 +- scripts/upgrade | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/.fonctions b/scripts/.fonctions index 6f8f1b2..9a04769 100644 --- a/scripts/.fonctions +++ b/scripts/.fonctions @@ -79,15 +79,15 @@ GENERATE_DB () { # Create a database and a dedicated user in the name of the app } SETUP_SOURCE () { # Download source, decompress and copu into $final_path - # $1 = Nom de l'archive téléchargée. - sudo wget -nv -i ../sources/source_url -O $1 + src=$(cat ../sources/source_md5 | awk -F' ' {'print $2'}) + sudo wget -nv -i ../sources/source_url -O $src # Checks the checksum of the downloaded source. - # md5sum -c ../sources/source_md5 --status + # md5sum -c ../sources/source_md5 --status || ynh_die "Corrupt source" # Decompress source - if [ "$(echo ${1##*.})" == "tgz" ]; then - tar -x -f $1 - elif [ "$(echo ${1##*.})" == "zip" ]; then - unzip -q $1 + if [ "$(echo ${src##*.})" == "tgz" ]; then + tar -x -f $src + elif [ "$(echo ${src##*.})" == "zip" ]; then + unzip -q $src else false # Unsupported archive format. fi diff --git a/scripts/install b/scripts/install index e6154b5..98b5843 100644 --- a/scripts/install +++ b/scripts/install @@ -47,7 +47,7 @@ GENERATE_DB $app # Create a database and a dedicated user in the app name sudo mkdir "$final_path" ynh_app_setting_set $app final_path $final_path -SETUP_SOURCE "spip-3.1.zip" +SETUP_SOURCE # Set permissions spip directory sudo chown -R www-data: $final_path diff --git a/scripts/upgrade b/scripts/upgrade index 3ff17f1..02733b2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -28,7 +28,7 @@ root_pwd=$(sudo cat /etc/yunohost/mysql) final_path=/var/www/$app -SETUP_SOURCE "spip-3.1.zip" +SETUP_SOURCE db_name=$app