1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/invidious_ynh.git synced 2024-09-03 19:15:55 +02:00

Update upgrade

This commit is contained in:
ericgaspar 2021-07-27 13:19:22 +02:00
parent 055fa5a366
commit b3c1bc90df

View file

@ -81,7 +81,6 @@ ynh_script_progression --message="Upgrading dependencies..." --weight=8
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
tempdir="$(mktemp -d)" tempdir="$(mktemp -d)"
ynh_setup_source --dest_dir=$tempdir --source_id=crystal ynh_setup_source --dest_dir=$tempdir --source_id=crystal
ynh_exec_warn_less dpkg -i $tempdir/crystal_1.0.0-1_amd64.deb ynh_exec_warn_less dpkg -i $tempdir/crystal_1.0.0-1_amd64.deb
@ -94,10 +93,10 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
ynh_script_progression --message="Upgrading source files..." --weight=5 ynh_script_progression --message="Upgrading source files..." --weight=5
tmpdir="$(mktemp -d)" #tmpdir="$(mktemp -d)"
# Backup the config file in the temp dir # Backup the config file in the temp dir
cp -a "$final_path/config/config.yml" "$tmpdir/config.yml" #cp -a "$final_path/config/config.yml" "$tmpdir/config.yml"
# Remove the app directory securely # Remove the app directory securely
#ynh_secure_remove --file=$final_path #ynh_secure_remove --file=$final_path
@ -110,10 +109,10 @@ then
popd popd
# Copy the admin saved settings from tmp directory to final path # Copy the admin saved settings from tmp directory to final path
cp -a "$tmpdir/config.yml" "$final_path/config/config.yml" #cp -a "$tmpdir/config.yml" "$final_path/config/config.yml"
# Remove the tmp directory securely # Remove the tmp directory securely
ynh_secure_remove --file="$tmpdir" #ynh_secure_remove --file="$tmpdir"
fi fi
chmod 750 "$final_path" chmod 750 "$final_path"
@ -129,6 +128,14 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." -
# Create a dedicated nginx config # Create a dedicated nginx config
ynh_add_nginx_config ynh_add_nginx_config
#=================================================
# MODIFY A CONFIG FILE
#=================================================
ynh_script_progression --message="Modifying a config file..."
ynh_add_config --template="../conf/config.yml" --destination="$final_path/config/config.yml"
chmod 600 $final_path/config/config.yml
#================================================= #=================================================
# SETUP SYSTEMD # SETUP SYSTEMD
#================================================= #=================================================