From d95ea16c0144d86c77d524d4f1ccca77c8f48df0 Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Tue, 5 Sep 2023 17:02:21 +0200 Subject: [PATCH] permit arch migration --- scripts/restore | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/scripts/restore b/scripts/restore index 7a44c5a..3a76001 100755 --- a/scripts/restore +++ b/scripts/restore @@ -21,6 +21,24 @@ chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R "$app":www-data "$install_dir" +#================================================= +# DOWNLOAD, CHECK AND UNPACK SOURCE +#================================================= + +# compare is the system arch is different from the binary arch +# if so, download the correct binary +if [ "$(uname -m)" != "$(file "$final_path"/Kavita | cut -d ',' -f 2 | tr -d ' ')" ] +then + ynh_script_progression --message="Migrating binary architecture..." --weight=1 + + # Download, check integrity, uncompress and patch the source from app.src + ynh_setup_source --dest_dir="$install_dir" --keep="config/appsettings.json" +fi + +chmod -R o-rwx "$install_dir" +chown -R "$app":www-data "$install_dir" +chmod +x "$install_dir"/Kavita + #================================================= # RESTORE SYSTEM CONFIGURATIONS #=================================================