summaryrefslogtreecommitdiff
path: root/scripts/archtype.sh
blob: cc241c82f709a5f3c2f450d4d2d8aac55fbf0a80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env bash

if [ ! -z "${GOHOSTARCH+x}" ]; then
    echo "${GOHOSTARCH}"
    exit 0
fi

ARCH=$(uname -m)

if [[ "${ARCH}" = "x86_64" ]]; then
    echo "amd64"
elif [[ "${ARCH}" = "armv6l" ]]; then
    echo "arm"
elif [[ "${ARCH}" = "armv7l" ]]; then
    echo "arm"
elif [[ "${ARCH}" = "aarch64" ]] || [[ "${ARCH}" = "arm64" ]]; then
    echo "arm64"
else
    # Anything else needs to be specifically added...
    echo "unsupported"
    exit 1
fi