Skip to content

Commit

Permalink
✨ v1.1.0 update shell
Browse files Browse the repository at this point in the history
  • Loading branch information
chaos-zhu committed Jun 27, 2022
1 parent 19c28ed commit 69f3a88
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 7 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

> 卸载:无服务残留
Expand Down
4 changes: 2 additions & 2 deletions easynode-client-install.sh → easynode-client-install-arm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
83 changes: 83 additions & 0 deletions easynode-client-install-x86.sh
Original file line number Diff line number Diff line change
@@ -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 "***********************安装成功***********************"
2 changes: 1 addition & 1 deletion easynode-server-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 69f3a88

Please sign in to comment.