Skip to content

Commit

Permalink
Merge branch 'hotfix/1.0.21.2-get-sh-fix'
Browse files Browse the repository at this point in the history
  • Loading branch information
uerkut committed Aug 4, 2022
2 parents 02bec1f + f9d0237 commit b2f76e7
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions get.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# This scripts has been taken from OpenFaas
# This scripts has been taken from OpenFaas
# and changed slightly.

# Copyright OpenFaaS Author(s) 2019
Expand Down Expand Up @@ -55,12 +55,12 @@ checkHash(){
targetFileDir=${targetFile%/*}

(cd $targetFileDir && curl -sSL $url.sha256|$sha_cmd -c >/dev/null)

if [ "$?" != "0" ]; then
rm $targetFile
echo "Binary checksum didn't match. Exiting"
exit 1
fi
fi
fi
}

Expand All @@ -69,9 +69,9 @@ getPackage() {
userid=$(id -u)
arch=$(uname -m)

if [ $arch == "x86_64" ]; then
if [ $arch = "x86_64" ]; then
arch="amd64"
elif [ $arch == "arm64" ]; then
elif [ $arch = "arm64" ]; then
arch="arm64"
fi

Expand All @@ -95,7 +95,7 @@ getPackage() {
suffix="$suffix-$arch"

targetFile="/tmp/$REPO$suffix"

if [ "$userid" != "0" ]; then
targetFile="$(pwd)/$REPO$suffix"
fi
Expand All @@ -118,7 +118,7 @@ getPackage() {
chmod +x $targetFile

echo "Download complete."

if [ ! -w "$BINLOCATION" ]; then

echo
Expand All @@ -129,11 +129,11 @@ getPackage() {
echo "============================================================"
echo
echo " sudo cp $REPO$suffix $BINLOCATION/$REPO"

if [ -n "$ALIAS_NAME" ]; then
echo " sudo ln -sf $BINLOCATION/$REPO $BINLOCATION/$ALIAS_NAME"
fi

echo

else
Expand All @@ -147,15 +147,15 @@ getPackage() {
echo "================================================================"
echo " $BINLOCATION/$REPO already exists and is not writeable"
echo " by the current user. Please adjust the binary ownership"
echo " or run sh/bash with sudo."
echo " or run sh/bash with sudo."
echo "================================================================"
echo
exit 1

fi

mv $targetFile $BINLOCATION/$REPO

if [ "$?" = "0" ]; then
echo "New version of $REPO installed to $BINLOCATION"
fi
Expand Down

0 comments on commit b2f76e7

Please sign in to comment.