use 'dpkg --print-architecture' to replace uname -m
				
					
				
			This commit is contained in:
		
							parent
							
								
									6e950b54cd
								
							
						
					
					
						commit
						809e0ba4be
					
				| @ -10,12 +10,18 @@ then | ||||
|   DEBIAN_VERSION=11 | ||||
| fi | ||||
| 
 | ||||
| echo "=== Enter architecture [amd64, i386, arm64, armhf] or [leave blank] for amd64"  | ||||
| read -p ">>> " DEBIAN_ARCH | ||||
| if [ -z "${DEBIAN_ARCH}" ] | ||||
| then | ||||
|   DEBIAN_ARCH=amd64 | ||||
| fi | ||||
| # 用 dpkg --print-architecture 更直接 | ||||
| ARCH=`dpkg --print-architecture` | ||||
| # if [[ "$(uname -m)" = "aarch64" ]]; | ||||
| # then | ||||
| #   ARCH=arm64 | ||||
| # elif [[ "$(uname -m)" = "armv7l" ]]; | ||||
| # then | ||||
| #   ARCH=arm | ||||
| # elif [[ "$(uname -m)" = "x86_64" ]]; | ||||
| # then | ||||
| #   ARCH=amd64 | ||||
| # fi | ||||
| 
 | ||||
| echo "=== Enter presets to download from [cdn, aws, china] or [leave blank] for cdn" | ||||
| read -p ">>> " PRESET | ||||
| @ -26,7 +32,7 @@ fi | ||||
| 
 | ||||
| sudo curl -fLO https://raw.githubusercontent.com/bohanyang/debi/master/debi.sh | ||||
| sudo chmod a+rx debi.sh | ||||
| sudo ./debi.sh --version $DEBIAN_VERSION --architecture $DEBIAN_ARCH --user root --$PRESET # --architecture 可参略,默认为 amd64;--password 可省略,则脚本启动后会问你要密码 | ||||
| sudo ./debi.sh --version $DEBIAN_VERSION --architecture $ARCH --user root --$PRESET # --architecture 可参略或者[amd64(默认), i386, arm64, armhf];--password 可省略,则脚本启动后会问你要密码 | ||||
| 
 | ||||
| echo "=== Shutdown now, wait for about 30 minutes (the project's github says 30 seconds), then try to ssh" | ||||
| sudo shutdown -r now | ||||
|  | ||||
| @ -15,31 +15,34 @@ else | ||||
|   fi | ||||
| fi | ||||
| 
 | ||||
| ARCH=amd64 | ||||
| # 用 dpkg --print-architecture 更直接 | ||||
| ARCH=`dpkg --print-architecture` | ||||
| # if [[ "$(uname -m)" = "aarch64" ]]; | ||||
| # then | ||||
| #   ARCH=arm64 | ||||
| # elif [[ "$(uname -m)" = "armv7l" ]]; | ||||
| # then | ||||
| #   ARCH=arm | ||||
| # elif [[ "$(uname -m)" = "x86_64" ]]; | ||||
| # then | ||||
| #   ARCH=amd64 | ||||
| # fi | ||||
| 
 | ||||
| OS=`uname | tr 'A-Z' 'a-z'` | ||||
| 
 | ||||
| echo "=== Install geth:[b] for 二进制, [s] for 源代码,[anything else or leave blank] for no change" | ||||
| read -p ">>> " BINARY_OR_SOURCE | ||||
| if [ "$BINARY_OR_SOURCE" == 'b' ] | ||||
| then | ||||
|   echo "--- 下载二进制 geth (https://geth.ethereum.org/downloads)" | ||||
|   # mkdir -p ./geth-temp/ | ||||
|   # cd ./geth-temp | ||||
|   if [ "$VERSION" == '1.10.26' ] | ||||
|   then | ||||
|     wget https://gethstore.blob.core.windows.net/builds/geth-linux-$ARCH-$VERSION-e5eb32ac.tar.gz -O geth-linux.tgz | ||||
|   elif [ "$VERSION" == '1.10.25' ] | ||||
|   then | ||||
|     wget https://gethstore.blob.core.windows.net/builds/geth-linux-$ARCH-$VERSION-69568c55.tar.gz -O geth-linux.tgz | ||||
|   else | ||||
|     echo "=== please find the download link in https://geth.ethereum.org/downloads" | ||||
|     read -p ">>> " DOWNLINK | ||||
|     wget $DOWNLINK -O geth-linux.tgz | ||||
|   fi | ||||
|   tar xzf ./geth-linux.tgz # --strip-components 1 ## 去掉tar包中顶级目录,因为顶级目录含有checksum,不方便在下一步进入 | ||||
|   echo "--- 下载二进制 geth (https://geth.ethereum.org/downloads) with correct hash" | ||||
|   read -p ">>> " DOWNLINK | ||||
|   # wget https://gethstore.blob.core.windows.net/builds/geth-$OS-$ARCH-$VERSION-$HASH.tar.gz -O geth-$OS-$ARCH-$VERSION.tgz | ||||
|   wget $DOWNLINK -O geth-$OS-$ARCH-$VERSION.tgz | ||||
|   tar xzf ./geth-$OS-$ARCH-$VERSION.tgz # --strip-components 1 ## 去掉tar包中顶级目录,因为顶级目录含有checksum,不方便在下一步进入 | ||||
|   echo "--- 安装到 /usr/local/bin/geth" | ||||
|   mv ./geth-linux-*/geth /usr/local/bin/ | ||||
|   mv ./geth-$OS-$ARCH-$VERSION-*/geth /usr/local/bin/ | ||||
|   echo "--- 删除原始文件" | ||||
|   rm -fr ./geth-linux.tgz ./geth-linux-$ARCH-$VERSION-*/ | ||||
|   rm -fr ./geth-$OS-$ARCH-$VERSION.tgz ./geth-$OS-$ARCH-$VERSION-*/ | ||||
| elif [ "$BINARY_OR_SOURCE" == 's' ] | ||||
| then | ||||
|   echo "--- 克隆并编译 geth" | ||||
|  | ||||
| @ -1,3 +1,5 @@ | ||||
| ## https://dist.ipfs.tech/ | ||||
| 
 | ||||
| defaultVERSION=0.18.1 | ||||
| 
 | ||||
| if [ $1 ] | ||||
| @ -12,19 +14,23 @@ else | ||||
|   fi | ||||
| fi | ||||
| 
 | ||||
| if [[ "$(uname -m)" = "aarch64" ]]; | ||||
| then | ||||
|   ARCH=arm64 | ||||
| elif [[ "$(uname -m)" = "armv7l" ]]; | ||||
| then | ||||
|   ARCH=arm | ||||
| elif [[ "$(uname -m)" = "x86_64" ]]; | ||||
| then | ||||
|   ARCH=amd64 | ||||
| fi | ||||
| # 用 dpkg --print-architecture 更直接 | ||||
| ARCH=`dpkg --print-architecture` | ||||
| # if [[ "$(uname -m)" = "aarch64" ]]; | ||||
| # then | ||||
| #   ARCH=arm64 | ||||
| # elif [[ "$(uname -m)" = "armv7l" ]]; | ||||
| # then | ||||
| #   ARCH=arm | ||||
| # elif [[ "$(uname -m)" = "x86_64" ]]; | ||||
| # then | ||||
| #   ARCH=amd64 | ||||
| # fi | ||||
| 
 | ||||
| echo Download https://dist.ipfs.tech/kubo/v$VERSION/kubo_v${VERSION}_linux-${ARCH}.tar.gz | ||||
| curl https://dist.ipfs.tech/kubo/v$VERSION/kubo_v${VERSION}_linux-${ARCH}.tar.gz -o kubo_v$VERSION.tgz | ||||
| OS=`uname | tr 'A-Z' 'a-z'` | ||||
| 
 | ||||
| echo Download https://dist.ipfs.tech/kubo/v$VERSION/kubo_v${VERSION}_${OS}-${ARCH}.tar.gz | ||||
| curl https://dist.ipfs.tech/kubo/v$VERSION/kubo_v${VERSION}_${OS}-${ARCH}.tar.gz -o kubo_v$VERSION.tgz | ||||
| tar xzf kubo_v$VERSION.tgz | ||||
| rm -fr kubo_v$VERSION.tgz | ||||
| ## install ./kubo/ipfs to /usr/local/bin/ipfs | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user