@@ -8,7 +8,7 @@ node="v20.12.2"
88arch=$( uname -m)
99
1010if [ " $( id -u) " -ne 0 ]; then
11- echo " This script must be run as root. Please use \" sudo bash\" instead. "
11+ echo " 这个脚本必须使用root权限运行。 请使用 \" sudo bash\" 替代它 "
1212 exit 1
1313fi
1414
@@ -32,7 +32,7 @@ echo_yellow() {
3232
3333# script info
3434echo_cyan " +----------------------------------------------------------------------
35- | MCSManager 安装脚本 (MCSManager Installer)
35+ | MCSManager Daemon安装脚本 (MCSManager Installer)
3636+----------------------------------------------------------------------
3737"
3838
@@ -44,25 +44,25 @@ Red_Error() {
4444}
4545
4646Install_Node () {
47- echo_cyan_n " [+] Install Node.JS environment ...\n"
47+ echo_cyan_n " [+] 安装 Node.JS...\n"
4848
4949 rm -irf " $node_install_path "
5050
51- cd /opt || Red_Error " [x] Failed to enter /opt"
51+ cd /opt || Red_Error " [x] 未能进入 /opt"
5252
5353 rm -rf " node-$node -linux-$arch .tar.gz"
5454
5555 # wget "https://nodejs.org/dist/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release"
56- wget " https://registry.npmmirror.com/-/binary/node/$node /node-$node -linux-$arch .tar.gz" || Red_Error " [x] Failed to download node release "
56+ wget " https://registry.npmmirror.com/-/binary/node/$node /node-$node -linux-$arch .tar.gz" || Red_Error " [x] 未能下载node "
5757
5858 tar -zxf " node-$node -linux-$arch .tar.gz" || Red_Error " [x] Failed to untar node"
5959
6060 rm -rf " node-$node -linux-$arch .tar.gz"
6161
6262 if [[ -f " $node_install_path " /bin/node ]] && [[ " $( " $node_install_path " /bin/node -v) " == " $node " ]]; then
63- echo_green " Success "
63+ echo_green " 完成 "
6464 else
65- Red_Error " [x] Node installation failed !"
65+ Red_Error " [x] Node 安装失败 !"
6666 fi
6767
6868 echo
@@ -76,7 +76,7 @@ Install_Node() {
7676}
7777
7878Install_MCSManager () {
79- echo_cyan " [+] Install MCSManager..."
79+ echo_cyan " [+] 安装 MCSManager..."
8080
8181 # stop service
8282 systemctl disable --now mcsm-{web,daemon}
@@ -85,13 +85,13 @@ Install_MCSManager() {
8585 rm -rf /etc/systemd/system/mcsm-daemon.service
8686 systemctl daemon-reload
8787
88- mkdir -p " ${mcsmanager_install_path} " || Red_Error " [x] Failed to create ${mcsmanager_install_path} "
88+ mkdir -p " ${mcsmanager_install_path} " || Red_Error " [x] 未能创建 ${mcsmanager_install_path} "
8989
9090 # cd /opt/mcsmanager
91- cd " ${mcsmanager_install_path} " || Red_Error " [x] Failed to enter ${mcsmanager_install_path} "
91+ cd " ${mcsmanager_install_path} " || Red_Error " [x] 未能进入 ${mcsmanager_install_path} "
9292
9393 # download MCSManager release
94- wget " ${mcsmanager_download_addr} " -O " ${package_name} " || Red_Error " [x] Failed to download MCSManager"
94+ wget " ${mcsmanager_download_addr} " -O " ${package_name} " || Red_Error " [x] 未能下载 MCSManager"
9595 tar -zxf ${package_name} -o || Red_Error " [x] Failed to untar ${package_name} "
9696 rm -rf " ${mcsmanager_install_path} /${package_name} "
9797
@@ -104,23 +104,23 @@ Install_MCSManager() {
104104 # echo "[→] cd daemon"
105105 cd " ${mcsmanager_install_path} /daemon" || Red_Error " [x] Failed to enter ${mcsmanager_install_path} /daemon"
106106
107- echo_cyan " [+] Install MCSManager-Daemon dependencies ..."
107+ echo_cyan " [+] 安装 MCSManager-Daemon 依赖库 ..."
108108 env " $node_install_path " /bin/node " $node_install_path " /bin/npm install --registry=https://registry.npmmirror.com --production --no-fund --no-audit & > /dev/null || Red_Error " [x] Failed to npm install in ${mcsmanager_install_path} /daemon"
109109
110110 echo
111111 echo_yellow " =============== MCSManager ==============="
112112 echo_green " Daemon: ${mcsmanager_install_path} /daemon"
113113 echo_yellow " =============== MCSManager ==============="
114114 echo
115- echo_green " [+] MCSManager installation success !"
115+ echo_green " [+] MCSManager 安装完成 !"
116116
117117 chmod -R 755 " $mcsmanager_install_path "
118118
119119 sleep 3
120120}
121121
122122Create_Service () {
123- echo_cyan " [+] Create MCSManager service ..."
123+ echo_cyan " [+] 创建 MCSManager 服务 ..."
124124
125125 echo " [Unit]
126126Description=MCSManager-Daemon
@@ -177,17 +177,17 @@ elif [[ $arch == s390x ]]; then
177177 arch=s390x
178178 # echo "[-] IBM LinuxONE architecture detected"
179179else
180- Red_Error " [x] Sorry, this architecture is not supported yet !\n[x]Please try to install manually : https://github.com/MCSManager/MCSManager#linux"
180+ Red_Error " [x] 对不起,这个架构目前还不受支持 !\n[x]请尝试手动安装 : https://github.com/MCSManager/MCSManager#linux"
181181fi
182182
183183# Define the variable Node installation directory
184184node_install_path=" /opt/node-$node -linux-$arch "
185185
186186# Check network connection
187- echo_cyan " [-] Architecture : $arch "
187+ echo_cyan " [-] 架构 : $arch "
188188
189189# Install related software
190- echo_cyan_n " [+] Installing dependent software (git, tar, wget)... "
190+ echo_cyan_n " [+] 正在安装依赖软件 (git, tar, wget)... "
191191if [[ -x " $( command -v yum) " ]]; then
192192 yum install -y git tar wget
193193elif [[ -x " $( command -v apt-get) " ]]; then
@@ -197,14 +197,14 @@ elif [[ -x "$(command -v pacman)" ]]; then
197197elif [[ -x " $( command -v zypper) " ]]; then
198198 zypper --non-interactive install git tar wget
199199else
200- echo_red " [!] Cannot find your package manager! You may need to install git, tar and wget manually !"
200+ echo_red " [!] 找不到你的软件包管理器! 你需要去安装 git, tar 和 wget!"
201201fi
202202
203203# Determine whether the relevant software is installed successfully
204204if [[ -x " $( command -v git) " && -x " $( command -v tar) " && -x " $( command -v wget) " ]]; then
205- echo_green " Success "
205+ echo_green " 完成 "
206206else
207- Red_Error " [x] Failed to find git, tar and wget, please install them manually !"
207+ Red_Error " [x] 找不到 git, tar 和 wget, 请先安装它们 !"
208208fi
209209
210210# Install the Node environment
0 commit comments