Skip to content

Commit

Permalink
add arm processor detection
Browse files Browse the repository at this point in the history
  • Loading branch information
robertpeteuil committed Jan 2, 2020
1 parent b31f47b commit f4f46c4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions terraform-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ set -e
# sudoInstall=true

scriptname=$(basename "$0")
scriptbuildnum="1.5.1"
scriptbuilddate="2018-10-19"
scriptbuildnum="1.5.2"
scriptbuilddate="2020-01-02"

# CHECK DEPENDANCIES AND SET NET RETRIEVAL TOOL
if ! unzip -h 2&> /dev/null; then
Expand Down Expand Up @@ -98,7 +98,10 @@ if [[ -z "$VERSION" ]]; then
fi
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
if [[ "$OS" == "linux" ]]; then
PROC=$(lscpu 2> /dev/null | awk '/Architecture/ {if($2 == "x86_64") {print "amd64"; exit} else {print "386"; exit}}')
PROC=$(lscpu 2> /dev/null | awk '/Architecture/ {if($2 == "x86_64") {print "amd64"; exit} else if($2 ~ /arm/) {print "arm"; exit} else {print "386"; exit}}')
if [[ -z $PROC ]]; then
PROC=$(cat /proc/cpuinfo | awk '/model\ name/ {if($0 ~ /ARM/) {print "arm"; exit}}')
fi
if [[ -z $PROC ]]; then
PROC=$(cat /proc/cpuinfo | awk '/flags/ {if($0 ~ /lm/) {print "amd64"; exit} else {print "386"; exit}}')
fi
Expand Down

0 comments on commit f4f46c4

Please sign in to comment.