1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/fider_ynh.git synced 2024-09-03 18:36:11 +02:00

upgrade: Fix when upgrading from /opt, we forgot to update the final_path variable and setting../..

This commit is contained in:
Salamandar 2023-01-10 23:43:23 +01:00
parent 8b80cdf043
commit b2b803c501

View file

@ -60,6 +60,17 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app
#================================================= #=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
# Moved fron /opt to /var/www
if [ -d "/opt/yunohost/$app" ]; then
# Changing final_path...
final_path=/var/www/$app
ynh_app_setting_set --app="$app" --key=final_path --value="$final_path"
# Moving old final_path to new final_path...
ynh_secure_remove "$final_path"
mv "/opt/yunohost/$app" "$final_path"
fi
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER
#================================================= #=================================================
@ -72,12 +83,6 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
# Moved fron /opt to /var/www
if [ -d "/opt/yunohost/$app" ]; then
ynh_secure_remove -f "$final_path"
mv "/opt/yunohost/$app" "$final_path"
fi
if [ "$upgrade_type" == "UPGRADE_APP" ] if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
ynh_script_progression --message="Upgrading source files..." --weight=1 ynh_script_progression --message="Upgrading source files..." --weight=1