From e8a48645b248103df95e12f2bbc3045c5c43de66 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 19 May 2022 13:05:10 +0200 Subject: [PATCH] Warning to other unsupported arch --- conf/{app.src => amd64.src} | 0 scripts/install | 8 +++++++- scripts/upgrade | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) rename conf/{app.src => amd64.src} (100%) diff --git a/conf/app.src b/conf/amd64.src similarity index 100% rename from conf/app.src rename to conf/amd64.src diff --git a/scripts/install b/scripts/install index 6fba995..19a5bc4 100755 --- a/scripts/install +++ b/scripts/install @@ -37,6 +37,12 @@ app=$YNH_APP_INSTANCE_NAME #================================================= ynh_script_progression --message="Validating installation parameters..." --weight=1 +# Check machine architecture (in particular, we don't support ARM and 32bit machines) +if [ $YNH_ARCH == "i386" ] || [ $YNH_ARCH == "armel" ] || [ $YNH_ARCH == "armhf" ] || [ $YNH_ARCH == "arm64" ] +then + ynh_die --message="Sorry, but this app can only be installed on a x86, 64 bits machine :(" +fi + final_path=/var/www/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" @@ -97,7 +103,7 @@ ynh_script_progression --message="Setting up source files..." --weight=3 ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$final_path" +ynh_setup_source --dest_dir="$final_path" --source_id=$YNH_ARCH chmod 750 "$final_path" chmod -R o-rwx "$final_path" diff --git a/scripts/upgrade b/scripts/upgrade index a1034dd..b3c28d9 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -94,7 +94,7 @@ then ynh_script_progression --message="Upgrading source files..." --weight=5 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" --keep="$final_path/config.toml" + ynh_setup_source --dest_dir="$final_path" --source_id=$YNH_ARCH --keep="$final_path/config.toml" fi chmod 750 "$final_path"