From 5dcf13d6d2b93874f9e2a4a52f8bc7589fa22b2d Mon Sep 17 00:00:00 2001 From: Luk Date: Tue, 2 Jul 2024 21:23:25 +0800 Subject: [PATCH] u --- geth-install.sh | 16 +++++++--------- ssh-run.sh | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/geth-install.sh b/geth-install.sh index c698195..46640a2 100755 --- a/geth-install.sh +++ b/geth-install.sh @@ -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/ diff --git a/ssh-run.sh b/ssh-run.sh index 8d9e9c6..8fd8bce 100644 --- a/ssh-run.sh +++ b/ssh-run.sh @@ -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[@]}"