diff --git a/scripts/install b/scripts/install index 2ed205e..1aa7825 100755 --- a/scripts/install +++ b/scripts/install @@ -78,6 +78,11 @@ ynh_script_progression --message="Installing dependencies..." ynh_install_app_dependencies $pkg_dependencies +tmpdir="$(mktemp -d)" +ynh_setup_source --dest_dir="$tmpdir" --source_id=$YNH_ARCH +dpkg -i $tmpdir/flood-linux.deb +ynh_secure_remove --file="$tmpdir" + #================================================= # CREATE DEDICATED USER #================================================= @@ -93,7 +98,7 @@ ynh_script_progression --message="Setting up source files..." ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$final_path" --source_id=$YNH_ARCH +mkdir -p "$final_path" chmod 750 "$final_path" chmod -R o-rwx "$final_path" @@ -109,14 +114,6 @@ ynh_add_nginx_config #================================================= # SPECIFIC SETUP -#================================================= -# INSTALL APP -#================================================= -ynh_script_progression --message="Installing app..." - -dpkg -i $final_path/flood-linux.deb -ynh_secure_remove --file="$final_path/flood-linux.deb" - #================================================= # CREATE DATA DIRECTORY #================================================= diff --git a/scripts/restore b/scripts/restore index 0e0934d..05677ae 100755 --- a/scripts/restore +++ b/scripts/restore @@ -31,7 +31,6 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) datadir=$(ynh_app_setting_get --app=$app --key=datadir) -port=$(ynh_app_setting_get --app=$app --key=port) scgi_port=$(ynh_app_setting_get --app=$app --key=scgi_port) rt_port=$(ynh_app_setting_get --app=$app --key=rt_port) @@ -94,15 +93,10 @@ ynh_script_progression --message="Reinstalling dependencies..." # Define and install dependencies ynh_install_app_dependencies $pkg_dependencies -#================================================= -# REINSTALL FLOOD -#================================================= -ynh_script_progression --message="Reinstalling flood..." - -# Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$final_path" --source_id=$YNH_ARCH -dpkg -i $final_path/flood-linux.deb -ynh_secure_remove --file="$final_path/flood-linux.deb" +tmpdir="$(mktemp -d)" +ynh_setup_source --dest_dir="$tmpdir" --source_id=$YNH_ARCH +dpkg -i $tmpdir/flood-linux.deb +ynh_secure_remove --file="$tmpdir" #================================================= # OPEN A PORT diff --git a/scripts/upgrade b/scripts/upgrade index fee9cef..babbe4c 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -73,7 +73,7 @@ then ynh_script_progression --message="Upgrading source files..." # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" --source_id=$YNH_ARCH + mkdir -p "$final_path" fi chmod 750 "$final_path" @@ -95,16 +95,13 @@ ynh_script_progression --message="Upgrading dependencies..." ynh_install_app_dependencies $pkg_dependencies +tmpdir="$(mktemp -d)" +ynh_setup_source --dest_dir="$tmpdir" --source_id=$YNH_ARCH +dpkg -i $tmpdir/flood-linux.deb +ynh_secure_remove --file="$tmpdir" + #================================================= # SPECIFIC UPGRADE -#================================================= -# INSTALL APP -#================================================= -ynh_script_progression --message="Installing app..." - -dpkg -i $final_path/flood-linux.deb -ynh_secure_remove --file="$final_path/flood-linux.deb" - #================================================= # SETUP SYSTEMD #=================================================