-
Notifications
You must be signed in to change notification settings - Fork 62
/
install.sh
80 lines (65 loc) · 1.99 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/bash
clear && echo "\
############################################################
Neko Neko Status 一键安装脚本
上次更新: 2021-11-07
Powered by Neko Neko Cloud
############################################################
"
echo "安装即将开始
如果您想取消安装, 请在 5 秒钟内按 Ctrl+C 终止此脚本"
sleep 5
clear && echo "正在安装npm,git,gcc"
yum install epel-release -y && yum install centos-release-scl git -y && yum install nodejs devtoolset-8-gcc* -y
apt update -y && apt-get install nodejs npm git build-essential -y
clear && echo "正在更新npm"
bash -c "npm install n -g"
source /root/.bashrc
bash -c "n latest"
source /root/.bashrc
bash -c "npm install npm@latest -g"
source /root/.bashrc
bash -c "npm install forever -g"
source /root/.bashrc
cd /root/
clear && echo "正在克隆仓库"
git clone https://github.com/nkeonkeo/nekonekostatus.git
cd nekonekostatus
git pull
clear && echo "正在安装依赖模块"
source /opt/rh/devtoolset-8/enable
npm install
echo "安装完成, 正在启动面板"
echo "[Unit]
Description=nekonekostatus
After=network.target
[Service]
Type=simple
Restart=always
RestartSec=5
ExecStart=/root/nekonekostatus/nekonekostatus.js
[Install]
WantedBy=multi-user.target" > /etc/systemd/system/nekonekostatus-dashboard.service
systemctl daemon-reload
systemctl enable nekonekostatus-dashboard.service
systemctl start nekonekostatus-dashboard.service
sleep 3
if systemctl status nekonekostatus-dashboard.service | grep "active (running)" > /dev/null
then
echo "面板启动成功"
echo ""
echo "默认访问端口: 5555"
echo "默认密码: nekonekostatus"
echo ""
echo "请及时修改密码!"
echo ""
echo "------------"
echo ""
echo "TIPS: "
echo "若无法访问, 请先尝试卸载防火墙, 并检查iptables规则"
echo "CentOS: yum remove firewalld -y"
echo "Debian: apt remove ufw -y"
else
echo "面板启动失败"
systemctl status nekonekostatus-dashboard.service
fi