From 69f3a882c05f42f82011401cb936124755ae8ecf Mon Sep 17 00:00:00 2001 From: chaos-zhu Date: Mon, 27 Jun 2022 14:02:16 +0800 Subject: [PATCH] :sparkles: v1.1.0 update shell --- README.md | 6 +- ...stall.sh => easynode-client-install-arm.sh | 4 +- easynode-client-install-x86.sh | 83 +++++++++++++++++++ easynode-server-install.sh | 2 +- 4 files changed, 88 insertions(+), 7 deletions(-) rename easynode-client-install.sh => easynode-client-install-arm.sh (95%) create mode 100644 easynode-client-install-x86.sh diff --git a/README.md b/README.md index 0d135f9..f797fcf 100644 --- a/README.md +++ b/README.md @@ -76,15 +76,13 @@ wget -qO- --no-check-certificate https://ghproxy.com/https://raw.githubuserconte - 占用端口:22022 -> 安装:支持后续一键升级 - #### X86架构 ```shell -wget -qO- --no-check-certificate https://ghproxy.com/https://raw.githubusercontent.com/chaos-zhu/easynode/master/easynode-client-install.sh | bash +wget -qO- --no-check-certificate https://ghproxy.com/https://raw.githubusercontent.com/chaos-zhu/easynode/master/easynode-client-install-x86.sh | bash ``` #### ARM架构 ```shell -待补充 +wget -qO- --no-check-certificate https://ghproxy.com/https://raw.githubusercontent.com/chaos-zhu/easynode/master/easynode-client-install-arm.sh | bash ``` > 卸载:无服务残留 diff --git a/easynode-client-install.sh b/easynode-client-install-arm.sh similarity index 95% rename from easynode-client-install.sh rename to easynode-client-install-arm.sh index 97d0c50..92a23cd 100644 --- a/easynode-client-install.sh +++ b/easynode-client-install-arm.sh @@ -42,8 +42,8 @@ echo "***********************创建文件PATH***********************" mkdir -p ${FILE_PATH} echo "***********************下载开始***********************" -DOWNLOAD_FILE_URL="https://ghproxy.com/https://github.com/chaos-zhu/easynode/releases/download/v1.0/easynode-client" -DOWNLOAD_SERVICE_URL="https://ghproxy.com/https://raw.githubusercontent.com/chaos-zhu/easynode/v1.0/client/easynode-client.service" +DOWNLOAD_FILE_URL="https://ghproxy.com/https://github.com/chaos-zhu/easynode/releases/download/v1.1/easynode-client-arm" +DOWNLOAD_SERVICE_URL="https://ghproxy.com/https://raw.githubusercontent.com/chaos-zhu/easynode/v1.1/client/easynode-client.service" # -O 指定路径和文件名(这里是二进制文件, 不需要扩展名) wget -O ${FILE_PATH}/${SERVER_NAME} --no-check-certificate --no-cache ${DOWNLOAD_FILE_URL} diff --git a/easynode-client-install-x86.sh b/easynode-client-install-x86.sh new file mode 100644 index 0000000..373c2e3 --- /dev/null +++ b/easynode-client-install-x86.sh @@ -0,0 +1,83 @@ +#!/bin/bash + +if [ "$(id -u)" != "0" ] ; then + echo "***********************请切换到root再尝试执行***********************" + exit 1 +fi + +SERVER_NAME=easynode-client +FILE_PATH=/root/local/easynode-client +SERVICE_PATH=/etc/systemd/system +SERVER_VERSION=v1.0 + +echo "***********************开始安装 easynode-client_${SERVER_VERSION}***********************" + +systemctl status ${SERVER_NAME} > /dev/null 2>&1 +if [ $? != 4 ] +then + echo "***********************停用旧服务***********************" + systemctl stop ${SERVER_NAME} + systemctl disable ${SERVER_NAME} + systemctl daemon-reload +fi + +if [ -f "${SERVICE_PATH}/${SERVER_NAME}.service" ] +then + echo "***********************移除旧服务***********************" + chmod 777 ${SERVICE_PATH}/${SERVER_NAME}.service + rm -Rf ${SERVICE_PATH}/${SERVER_NAME}.service + systemctl daemon-reload +fi + +if [ -d ${FILE_PATH} ] +then + echo "***********************移除旧文件***********************" + chmod 777 ${FILE_PATH} + rm -Rf ${FILE_PATH} +fi + +# 开始安装 + +echo "***********************创建文件PATH***********************" +mkdir -p ${FILE_PATH} + +echo "***********************下载开始***********************" +DOWNLOAD_FILE_URL="https://ghproxy.com/https://github.com/chaos-zhu/easynode/releases/download/v1.1/easynode-client-x86" +DOWNLOAD_SERVICE_URL="https://ghproxy.com/https://raw.githubusercontent.com/chaos-zhu/easynode/v1.1/client/easynode-client.service" + +# -O 指定路径和文件名(这里是二进制文件, 不需要扩展名) +wget -O ${FILE_PATH}/${SERVER_NAME} --no-check-certificate --no-cache ${DOWNLOAD_FILE_URL} +if [ $? != 0 ] +then + echo "***********************下载${SERVER_NAME}失败***********************" + exit 1 +fi + +wget -O ${FILE_PATH}/${SERVER_NAME}.service --no-check-certificate --no-cache ${DOWNLOAD_SERVICE_URL} + +if [ $? != 0 ] +then + echo "***********************下载${SERVER_NAME}.service失败***********************" + exit 1 +fi + +echo "***********************下载成功***********************" + +# echo "***********************设置权限***********************" +chmod +x ${FILE_PATH}/${SERVER_NAME} +chmod 777 ${FILE_PATH}/${SERVER_NAME}.service + +# echo "***********************移动service&reload***********************" +mv ${FILE_PATH}/${SERVER_NAME}.service ${SERVICE_PATH} + +# echo "***********************daemon-reload***********************" +systemctl daemon-reload + +echo "***********************启动服务***********************" +systemctl start ${SERVER_NAME} + + +# echo "***********************设置开机启动***********************" +systemctl enable ${SERVER_NAME} + +echo "***********************安装成功***********************" diff --git a/easynode-server-install.sh b/easynode-server-install.sh index 286c1bb..0ca3faa 100644 --- a/easynode-server-install.sh +++ b/easynode-server-install.sh @@ -41,7 +41,7 @@ echo "pm2 version: $(pm2 -v) 安装成功" echo '开始下载EasyNode' -DOWNLOAD_FILE_URL="https://ghproxy.com/https://github.com/chaos-zhu/easynode/releases/download/v1.0/easynode-server.zip" +DOWNLOAD_FILE_URL="https://ghproxy.com/https://github.com/chaos-zhu/easynode/releases/download/v1.1/easynode-server.zip" SERVER_NAME=easynode-server SERVER_ZIP=easynode-server.zip FILE_PATH=/root