diff --git a/README.md b/README.md index 0a7ecce..59eae0f 100644 --- a/README.md +++ b/README.md @@ -15,15 +15,15 @@ Options: - install specific version: `-i VERSION` - automatically `sudo` install to /usr/local/bin: `-a` - prevents user prompt asking for install destination - - user must enter sudo password unless NOPASSWD is enabled - - uncomment line 12 to make this the default behavior (`sudoInstall=true`) + - user will still need to enter sudo password unless NOPASSWD is enabled + - set as default behavior by uncommenting line 12 (`sudoInstall=true`) ### Installation with this Installer Download the installer and make executable ``` shell -curl -LO https://raw.github.com/robertpeteuil/terraform-installer/master/terraform-install.sh +wget https://raw.github.com/robertpeteuil/terraform-installer/master/terraform-install.sh chmod +x terraform-install.sh ``` @@ -39,7 +39,7 @@ Optional Parameters # -i = Install specific version ./terraform-install.sh -i 0.11.1 -# -a = Automatic sudo install to /usr/local/bin/ +# -a = Automatic sudo install to /usr/local/bin/ (no user prompt) ./terraform-install.sh -a ``` @@ -53,8 +53,7 @@ Optional Parameters ### System Requirements - System with Bash Shell (Linux, macOS, Windows Subsystem for Linux) -- `curl` -- `unzip` - terraform downloads in zip format +- `unzip` - terraform downloads are in zip format ### Script Process Details diff --git a/terraform-install.sh b/terraform-install.sh index aaa2df2..aad8930 100755 --- a/terraform-install.sh +++ b/terraform-install.sh @@ -12,7 +12,7 @@ # sudoInstall=true scriptname=$(basename "$0") -scriptbuildnum="1.1.3" +scriptbuildnum="1.2.0" scriptbuilddate="2018-04-11" LATEST=$(wget -q -O- https://api.github.com/repos/hashicorp/terraform/releases/latest 2> /dev/null | awk '/tag_name/ {print $2}' | cut -d '"' -f 2 | cut -d 'v' -f 2) @@ -65,7 +65,7 @@ fi # CREATE FILENAME AND DOWNLOAD LINK BASED ON GATHERED PARAMETERS FILENAME="terraform_${VERSION}_${OS}_${PROC}.zip" LINK="https://releases.hashicorp.com/terraform/${VERSION}/${FILENAME}" -LINKVALID=$(curl -o /dev/null --silent --head --write-out '%{http_code}\n' "$LINK") +LINKVALID=$(wget --spider -S "$LINK" 2>&1 | grep "HTTP/" | awk '{print $2}') # VERIFY LINK VALIDITY if [[ "$LINKVALID" != 200 ]]; then @@ -113,7 +113,7 @@ mkdir -p "$UTILTMPDIR" cd "$UTILTMPDIR" || exit 1 # DOWNLOAD AND EXTRACT -curl -s -o "$FILENAME" "$LINK" +wget -q "$LINK" -O "$FILENAME" unzip -qq "$FILENAME" || exit 1 # COPY TO DESTINATION