u
This commit is contained in:
parent
891b4a1a6e
commit
5dcf13d6d2
@ -1,18 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
defaultVERSION=1.11.2
|
||||
|
||||
if [ $1 ]
|
||||
then
|
||||
VERSION=$1
|
||||
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
|
||||
if [ ! "$VERSION" ]
|
||||
then
|
||||
VERSION=$defaultVERSION
|
||||
echo Use default version $defaultVERSION
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$(uname)" = "Linux" ]
|
||||
@ -39,7 +32,12 @@ read -p ">>> " BINARY_OR_SOURCE
|
||||
if [ "$BINARY_OR_SOURCE" == 'b' ]
|
||||
then
|
||||
echo "--- Extracting download link with correct hash from https://geth.ethereum.org/downloads"
|
||||
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
|
||||
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
|
||||
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,不方便在下一步进入
|
||||
echo "--- 安装到 /usr/local/bin/geth"
|
||||
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
|
||||
then
|
||||
selected_index=$1
|
||||
selected_index=$1-1
|
||||
else
|
||||
echo "Select a target to connect via SSH:"
|
||||
select target in "${labels[@]}"
|
||||
|
Loading…
Reference in New Issue
Block a user