u
This commit is contained in:
parent
891b4a1a6e
commit
5dcf13d6d2
@ -1,18 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
defaultVERSION=1.11.2
|
|
||||||
|
|
||||||
if [ $1 ]
|
if [ $1 ]
|
||||||
then
|
then
|
||||||
VERSION=$1
|
VERSION=$1
|
||||||
else
|
else
|
||||||
echo "=== Enter geth [version number] or [leave blank] for default $defaultVERSION"
|
echo "=== Enter geth \n [version number] for example 1.10.26 \n [leave blank] for the latest version"
|
||||||
read -p ">>> " VERSION
|
read -p ">>> " VERSION
|
||||||
if [ ! "$VERSION" ]
|
|
||||||
then
|
|
||||||
VERSION=$defaultVERSION
|
|
||||||
echo Use default version $defaultVERSION
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$(uname)" = "Linux" ]
|
if [ "$(uname)" = "Linux" ]
|
||||||
@ -39,7 +32,12 @@ read -p ">>> " BINARY_OR_SOURCE
|
|||||||
if [ "$BINARY_OR_SOURCE" == 'b' ]
|
if [ "$BINARY_OR_SOURCE" == 'b' ]
|
||||||
then
|
then
|
||||||
echo "--- Extracting download link with correct hash from https://geth.ethereum.org/downloads"
|
echo "--- Extracting download link with correct hash from https://geth.ethereum.org/downloads"
|
||||||
|
if [ "$VERSION" != '' ]
|
||||||
|
then
|
||||||
wget https://gethstore.blob.core.windows.net/builds/`curl -s -L -o - 'https://geth.ethereum.org/downloads' | grep -o -m 1 "geth-$OS-$ARCH-$VERSION-[0-9a-f]*.tar.gz" | head -n 1` -O geth-binary-temp.tgz
|
wget https://gethstore.blob.core.windows.net/builds/`curl -s -L -o - 'https://geth.ethereum.org/downloads' | grep -o -m 1 "geth-$OS-$ARCH-$VERSION-[0-9a-f]*.tar.gz" | head -n 1` -O geth-binary-temp.tgz
|
||||||
|
else
|
||||||
|
wget https://gethstore.blob.core.windows.net/builds/`curl -s -L -o - 'https://geth.ethereum.org/downloads' | grep -o -m 1 "geth-$OS-$ARCH-[0-9.]*-[0-9a-f]*.tar.gz" | head -n 1` -O geth-binary-temp.tgz
|
||||||
|
fi
|
||||||
tar xzf ./geth-binary-temp.tgz # --strip-components 1 ## 去掉tar包中顶级目录,因为顶级目录含有checksum,不方便在下一步进入
|
tar xzf ./geth-binary-temp.tgz # --strip-components 1 ## 去掉tar包中顶级目录,因为顶级目录含有checksum,不方便在下一步进入
|
||||||
echo "--- 安装到 /usr/local/bin/geth"
|
echo "--- 安装到 /usr/local/bin/geth"
|
||||||
sudo mv ./geth-$OS-$ARCH-*/geth /usr/local/bin/
|
sudo mv ./geth-$OS-$ARCH-*/geth /usr/local/bin/
|
||||||
|
@ -30,7 +30,7 @@ privateKeyPaths=($(jq -r '.["sshfs.configs"][] | .privateKeyPath' "$SETTINGS_FIL
|
|||||||
|
|
||||||
if [ "$1" -ge 0 ] 2>/dev/null && [ "$1" -le ${#hosts[@]} ] 2>/dev/null
|
if [ "$1" -ge 0 ] 2>/dev/null && [ "$1" -le ${#hosts[@]} ] 2>/dev/null
|
||||||
then
|
then
|
||||||
selected_index=$1
|
selected_index=$1-1
|
||||||
else
|
else
|
||||||
echo "Select a target to connect via SSH:"
|
echo "Select a target to connect via SSH:"
|
||||||
select target in "${labels[@]}"
|
select target in "${labels[@]}"
|
||||||
|
Loading…
Reference in New Issue
Block a user