2019-01-09 09:31:49 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2021-07-06 17:45:33 +02:00
|
|
|
#=================================================
|
|
|
|
# COMMON VARIABLES
|
|
|
|
#=================================================
|
2019-01-09 09:31:49 +01:00
|
|
|
|
2021-07-06 17:45:33 +02:00
|
|
|
# dependencies used by the app
|
|
|
|
pkg_dependencies=""
|
2019-01-09 09:31:49 +01:00
|
|
|
|
2021-07-06 17:45:33 +02:00
|
|
|
#=================================================
|
|
|
|
# PERSONAL HELPERS
|
|
|
|
#=================================================
|
2019-01-09 09:31:49 +01:00
|
|
|
|
2021-07-06 17:45:33 +02:00
|
|
|
#=================================================
|
|
|
|
# EXPERIMENTAL HELPERS
|
|
|
|
#=================================================
|
2019-01-09 09:31:49 +01:00
|
|
|
|
2021-07-06 17:45:33 +02:00
|
|
|
#=================================================
|
|
|
|
# FUTURE OFFICIAL HELPERS
|
|
|
|
#=================================================
|
2019-01-09 09:31:49 +01:00
|
|
|
|
2021-07-06 17:45:33 +02:00
|
|
|
# Check the architecture
|
2019-01-09 09:31:49 +01:00
|
|
|
#
|
2021-07-06 17:45:33 +02:00
|
|
|
# example: architecture=$(ynh_detect_arch)
|
2019-01-09 09:31:49 +01:00
|
|
|
#
|
2021-07-06 17:45:33 +02:00
|
|
|
# usage: ynh_detect_arch
|
2019-01-09 09:31:49 +01:00
|
|
|
#
|
2021-07-06 17:45:33 +02:00
|
|
|
# Requires YunoHost version 2.2.4 or higher.
|
|
|
|
ynh_detect_arch(){
|
|
|
|
local architecture
|
|
|
|
if [ -n "$(uname -m | grep arm64)" ] || [ -n "$(uname -m | grep aarch64)" ]; then
|
2021-07-06 17:52:34 +02:00
|
|
|
architecture="arm64"
|
2021-07-06 17:45:33 +02:00
|
|
|
elif [ -n "$(uname -m | grep 64)" ]; then
|
|
|
|
architecture="x86-64"
|
|
|
|
elif [ -n "$(uname -m | grep armv7)" ]; then
|
|
|
|
architecture="armv7"
|
|
|
|
elif [ -n "$(uname -m | grep armv6)" ]; then
|
|
|
|
architecture="armv6"
|
|
|
|
elif [ -n "$(uname -m | grep armv5)" ]; then
|
|
|
|
architecture="armv5"
|
|
|
|
else
|
|
|
|
architecture="unknown"
|
|
|
|
fi
|
|
|
|
echo $architecture
|
2019-01-09 09:31:49 +01:00
|
|
|
}
|