diff --git a/scripts/upgrade b/scripts/upgrade index 45a3dfd..f657dc0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -56,17 +56,18 @@ then usermod -m -d /home/yunohost.app/$app $app fi -#10.17.0 has a bug that overwrite the media path. +#10.17.0, 10.17.1 & 10.16.0 had a bug that overwrite the media path at installation. #https://github.com/UniversalMediaServer/UniversalMediaServer/issues/2864 #This will reinitialize it to /home/yunohost.multimedia/share -if [ $(ynh_app_upstream_version --manifest="/etc/yunohost/apps/$app/manifest.json") == "10.17.0" ] +if [ $(ynh_app_upstream_version --manifest="/etc/yunohost/apps/$app/manifest.json") <= "10.17.0" ] then - ynh_replace_string --match_string="folders =/opt/yunohost/ums,/home/yunohost.app/ums" \ + ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" + ynh_replace_string --match_string="folders =/opt/yunohost/$app,/home/yunohost.app/$app" \ --replace_string="folders=/home/yunohost.multimedia/share" \ - --target_file="/home/yunohost.app/ums/.config/UMS/UMS.conf" - ynh_replace_string --match_string="folders_monitored =/opt/yunohost/ums,/home/yunohost.app/ums" \ + --target_file="/home/yunohost.app/$app/.config/UMS/UMS.conf" + ynh_replace_string --match_string="folders_monitored =/opt/yunohost/$app,/home/yunohost.app/$app" \ --replace_string="folders_monitored=/home/yunohost.multimedia/share" \ - --target_file="/home/yunohost.app/ums/.config/UMS/UMS.conf" + --target_file="/home/yunohost.app/$app/.config/UMS/UMS.conf" fi #=================================================