diff --git a/scripts/backup b/scripts/backup index fc5c764..96a872c 100755 --- a/scripts/backup +++ b/scripts/backup @@ -6,9 +6,19 @@ # IMPORT GENERIC HELPERS #================================================= +source ../settings/scripts/detect_arch source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers +#================================================= +# MANAGE APPLICATION NOT COMPATIBLE WITH ARM +#================================================= + +if [ $architecture = "arm" ] +then + ynh_die "WriteFreely not available on Arm" +fi + #================================================= # MANAGE SCRIPT FAILURE #================================================= diff --git a/scripts/change_url b/scripts/change_url index 7f71444..1f71445 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -6,9 +6,19 @@ # IMPORT GENERIC HELPERS #================================================= +source detect_arch source _common.sh source /usr/share/yunohost/helpers +#================================================= +# MANAGE APPLICATION NOT COMPATIBLE WITH ARM +#================================================= + +if [ $architecture = "arm" ] +then + ynh_die "WriteFreely not available on Arm" +fi + #================================================= # RETRIEVE ARGUMENTS #================================================= diff --git a/scripts/detect_arch b/scripts/detect_arch new file mode 100644 index 0000000..4e258d9 --- /dev/null +++ b/scripts/detect_arch @@ -0,0 +1,12 @@ +#!/bin/bash + +if [ -n "$(uname -m | grep 64)" ]; then + architecture="x86-64" +elif [ -n "$(uname -m | grep 86)" ]; then + architecture="i386" +elif [ -n "$(uname -m | grep arm)" ]; then + architecture="arm" +else + ynh_die "Unable to detect your achitecture, please open a bug describing \ + your hardware and the result of the command \"uname -m\"." 1 +fi diff --git a/scripts/install b/scripts/install index bca64e6..c82e337 100755 --- a/scripts/install +++ b/scripts/install @@ -6,9 +6,19 @@ # IMPORT GENERIC HELPERS #================================================= +source detect_arch source _common.sh source /usr/share/yunohost/helpers +#================================================= +# MANAGE APPLICATION NOT COMPATIBLE WITH ARM +#================================================= + +if [ $architecture = "arm" ] +then + ynh_die "WriteFreely not available on Arm" +fi + #================================================= # MANAGE SCRIPT FAILURE #================================================= @@ -20,12 +30,6 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors -arch=$(uname -m) -if [[ $arch == arm* ]] -then - ynh_die "WriteFreely not available on Arm" -fi - #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= diff --git a/scripts/remove b/scripts/remove index 79cb21c..7d890b0 100755 --- a/scripts/remove +++ b/scripts/remove @@ -6,9 +6,19 @@ # IMPORT GENERIC HELPERS #================================================= +source detect_arch source _common.sh source /usr/share/yunohost/helpers +#================================================= +# MANAGE APPLICATION NOT COMPATIBLE WITH ARM +#================================================= + +if [ $architecture = "arm" ] +then + ynh_die "WriteFreely not available on Arm" +fi + #================================================= # LOAD SETTINGS #================================================= diff --git a/scripts/restore b/scripts/restore index a427469..24978a3 100755 --- a/scripts/restore +++ b/scripts/restore @@ -6,9 +6,19 @@ # IMPORT GENERIC HELPERS #================================================= +source ../settings/scripts/detect_arch source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers +#================================================= +# MANAGE APPLICATION NOT COMPATIBLE WITH ARM +#================================================= + +if [ $architecture = "arm" ] +then + ynh_die "WriteFreely not available on Arm" +fi + #================================================= # MANAGE SCRIPT FAILURE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index ebdca4f..d27f63d 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -6,9 +6,19 @@ # IMPORT GENERIC HELPERS #================================================= +source detect_arch source _common.sh source /usr/share/yunohost/helpers +#================================================= +# MANAGE APPLICATION NOT COMPATIBLE WITH ARM +#================================================= + +if [ $architecture = "arm" ] +then + ynh_die "WriteFreely not available on Arm" +fi + #================================================= # LOAD SETTINGS #=================================================