mirror of
https://github.com/YunoHost-Apps/simple-torrent_ynh.git
synced 2024-09-03 20:26:18 +02:00
Update _common.sh
This commit is contained in:
parent
6506e4b1bd
commit
7dd3b01323
1 changed files with 21 additions and 0 deletions
|
@ -15,3 +15,24 @@
|
|||
#=================================================
|
||||
# FUTURE OFFICIAL HELPERS
|
||||
#=================================================
|
||||
|
||||
# Check the architecture
|
||||
#
|
||||
# example: architecture=$(ynh_detect_arch)
|
||||
#
|
||||
# usage: ynh_detect_arch
|
||||
#
|
||||
# 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
|
||||
architecture="arm64"
|
||||
elif [ -n "$(uname -m | grep 86)" ]; then
|
||||
architecture="i386"
|
||||
elif [ -n "$(uname -m | grep 64)" ]; then
|
||||
architecture="x86_64"
|
||||
else
|
||||
architecture="unknown"
|
||||
fi
|
||||
echo $architecture
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue