summaryrefslogtreecommitdiff
path: root/getarch.sh
diff options
context:
space:
mode:
Diffstat (limited to 'getarch.sh')
-rwxr-xr-xgetarch.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/getarch.sh b/getarch.sh
new file mode 100755
index 0000000..718a64f
--- /dev/null
+++ b/getarch.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+machine="$(uname -m)"
+
+if [ "${machine}" == "x64" ] || [ "${machine}" == "x86_64" ]
+then
+ printf "amd64"
+elif [ "${machine}" == "arm" ]
+then
+ printf "arm"
+elif [ "${machine}" == "aarch64" ] || [ "${machine}" == "aarch64_be" ] || [ "${machine}" == "arm64" ] || [ "${machine}" == "armv8b" ] || [ "${machine}" == "armv8l" ]
+then
+ printf "arm64"
+elif [ "${machine}" == "i386" ] || [ "${machine}" == "i686" ] || [ "${machine}" == "x86" ]
+then
+ printf "arm64"
+else
+ printf "unknown"
+fi