forked from zdz/ServerStatus-Rust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
one-touch.sh
37 lines (27 loc) · 1.08 KB
/
one-touch.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
#!/bin/bash
set -ex
WORKSPACE=/opt/ServerStatus
mkdir -p ${WORKSPACE}
cd ${WORKSPACE}
# 下载, arm 机器替换 x86_64 为 aarch64
wget --no-check-certificate -qO ServerStatus-x86_64-unknown-linux-musl.zip "https://github.com/zdz/ServerStatus-Rust/releases/download/latest/ServerStatus-x86_64-unknown-linux-musl.zip"
unzip -o ServerStatus-x86_64-unknown-linux-musl.zip
# systemd service
mv -v stat_server.service /etc/systemd/system/stat_server.service
mv -v stat_client.service /etc/systemd/system/stat_client.service
systemctl daemon-reload
# 启动
systemctl start stat_server
systemctl start stat_client
# 状态查看
systemctl status stat_server
systemctl status stat_client
# 使用以下命令开机自启
# systemctl enable stat_server
# systemctl enable stat_client
# 停止
# systemctl stop stat_server
# systemctl stop stat_client
# https://fedoraproject.org/wiki/Systemd/zh-cn
# https://docs.fedoraproject.org/en-US/quick-docs/understanding-and-administering-systemd/index.html
# 修改 /etc/systemd/system/stat_client.service 文件,将IP改为你服务器的IP或你的域名