diff --git a/debian-config.Dockerfile b/debian-setup.Dockerfile similarity index 79% rename from debian-config.Dockerfile rename to debian-setup.Dockerfile index fdbe12d..fedbeff 100644 --- a/debian-config.Dockerfile +++ b/debian-setup.Dockerfile @@ -2,7 +2,7 @@ FROM debian:11.5 LABEL org.opencontainers.image.authors="luk" RUN apt update && apt install curl -y -RUN curl https://git.faronear.org/fon/sysconfig/raw/branch/main/debian-config.sh > ~/debian-config.sh && echo -e "l\n\n\n\n\n" | bash ~/debian-config.sh +RUN curl https://git.faronear.org/fon/sysconfig/raw/branch/main/debian-setup.sh > ~/debian-setup.sh && echo -e "l\n\n\n\n\n" | bash ~/debian-setup.sh CMD bash diff --git a/debian-config.sh b/debian-setup.sh old mode 100755 new mode 100644 similarity index 98% rename from debian-config.sh rename to debian-setup.sh index e08f806..8092f49 --- a/debian-config.sh +++ b/debian-setup.sh @@ -2,7 +2,7 @@ echo "Usage: this.sh [NewUser]" echo "Example: this.sh alice" -echo "curl https://git.faronear.org/fon/sysconfig/raw/branch/main/debian-config.sh > ~/debian-config.sh && bash ~/debian-config.sh" +echo "curl https://git.faronear.org/fon/sysconfig/raw/branch/main/debian-setup.sh > ~/debian-setup.sh && bash ~/debian-setup.sh" if [ "$1" ] then diff --git a/geth-install.sh b/geth-install.sh index baef2c6..c3fb909 100644 --- a/geth-install.sh +++ b/geth-install.sh @@ -1,6 +1,6 @@ #!/bin/bash -defaultVERSION=1.10.26 +defaultVERSION=1.11.2 if [ $1 ] then @@ -15,6 +15,7 @@ else fi fi +ARCH=amd64 echo "=== Install geth:[b] for 二进制, [s] for 源代码,[anything else or leave blank] for no change" read -p ">>> " BINARY_OR_SOURCE @@ -25,21 +26,20 @@ then # cd ./geth-temp if [ "$VERSION" == '1.10.26' ] then - wget https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.10.26-e5eb32ac.tar.gz -O geth-linux-amd64-$VERSION.tgz + 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-amd64-1.10.25-69568c55.tar.gz -O geth-linux-amd64-$VERSION.tgz + 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-amd64-$VERSION.tgz + wget $DOWNLINK -O geth-linux.tgz fi - tar xzf ./geth-linux-amd64-$VERSION.tgz # --strip-components 1 ## 去掉tar包中顶级目录,因为顶级目录含有checksum,不方便在下一步进入 + tar xzf ./geth-linux.tgz # --strip-components 1 ## 去掉tar包中顶级目录,因为顶级目录含有checksum,不方便在下一步进入 echo "--- 安装到 /usr/local/bin/geth" - mv ./geth-linux-amd64-*/geth /usr/local/bin/ - # echo "--- 删除原始文件" - # cd .. - # rm -fr ./geth-temp + mv ./geth-linux-*/geth /usr/local/bin/ + echo "--- 删除原始文件" + rm -fr ./geth-linux.tgz ./geth-linux-$ARCH-$VERSION-*/ elif [ "$BINARY_OR_SOURCE" == 's' ] then echo "--- 克隆并编译 geth" diff --git a/ipfs-install.sh b/ipfs-install.sh index 7668093..4ba593b 100755 --- a/ipfs-install.sh +++ b/ipfs-install.sh @@ -12,11 +12,24 @@ else fi fi -echo Download https://dist.ipfs.tech/kubo/v$VERSION/kubo_v${VERSION}_linux-amd64.tar.gz -curl https://dist.ipfs.tech/kubo/v$VERSION/kubo_v${VERSION}_linux-amd64.tar.gz -o kubo_v$VERSION.tgz +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 tar xzf kubo_v$VERSION.tgz +rm -fr kubo_v$VERSION.tgz ## install ./kubo/ipfs to /usr/local/bin/ipfs cd kubo && sudo bash install.sh +cd .. && rm -fr kubo/ # echo "alias ipfs=`pwd`/kubo/ipfs" >> ~/.bashrc_custom # alias ipfs=`pwd`/kubo/ipfs diff --git a/nvm-install.sh b/nvm-install.sh index d50f839..1a7ee73 100755 --- a/nvm-install.sh +++ b/nvm-install.sh @@ -16,7 +16,7 @@ git clone https://github.com/nvm-sh/nvm.git ~/.nvm -echo If in China, set mirror before nvm install -echo ######################################################################## +echo +echo '############## If in China, set mirror before nvm install ##############' echo export NVM_NODEJS_ORG_MIRROR=https://npm.taobao.org/mirrors/node -echo ######################################################################## +echo '########################################################################'