diff --git a/scripts/upgrade b/scripts/upgrade index 83bd7e8..7bb2d94 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -338,13 +338,15 @@ ynh_system_user_create --username="$app" --home_dir="$final_path" # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Upgrading source files..." +# detect_arch comes from _common.sh / personnal helpers +architecture="$(detect_arch)" + +# compare is the system arch is different from the binary arch +# if so, download the correct binary +if [ "$architecture" != "$(file "$final_path"/gotosocial | cut -d ',' -f 2 | tr -d ' ')" ] +then + ynh_script_progression --message="Migrating binary architecture..." - # detect_arch comes from _common.sh / personnal helpers - architecture=$(detect_arch) - # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" --keep="config.yaml" fi