1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/jackett_ynh.git synced 2024-09-03 19:26:28 +02:00
jackett_ynh/scripts/_common.sh
2021-05-25 23:28:22 +02:00

33 lines
1.1 KiB
Bash

#!/bin/bash
#=================================================
# COMMON VARIABLES
#=================================================
# Supported architectures
supported_architectures=("arm" "arm64" "x64")
#=================================================
# PERSONAL HELPERS
#=================================================
get_architecture() {
architecture=$(dpkg --print-architecture)
if [ $architecture = "amd64" ]; then
architecture="x64"
elif [[ $architecture = arm* ]] && [[ $(getconf LONG_BIT) = 32 ]]; then
architecture="arm"
elif [[ $architecture = arm* ]] && [[ $(getconf LONG_BIT) = 64 ]]; then
architecture="arm64"
elif [[ $(echo ${supported_architectures[@]} | grep -ow "$architecture" | wc -w) = 0 ]]; then
ynh_die --message="Unsupported architecture $architecture"
fi
}
#=================================================
# EXPERIMENTAL HELPERS
#=================================================
#=================================================
# FUTURE OFFICIAL HELPERS
#=================================================