mirror of
https://github.com/snowykami/server-status-client.git
synced 2024-11-22 15:18:00 +08:00
✨ 修复脚本执行错误
This commit is contained in:
parent
c271378c71
commit
fb7e3144d3
@ -24,7 +24,7 @@ _✨ 服务器状态 - 客户端 ✨_
|
||||
- Linux 可使用脚本安装,带自动部署和自启动
|
||||
|
||||
```shell
|
||||
curl -sSL https://raw.githubusercontent.com/snowykami/server-status-client/refs/heads/main/deploy.sh | sudo bash
|
||||
curl -sSL https://raw.githubusercontent.com/snowykami/server-status-client/refs/heads/main/deploy.sh -o /tmp/deploy.sh && sudo bash /tmp/deploy.sh && rm /tmp/deploy.sh
|
||||
```
|
||||
|
||||
- 或手动部署
|
||||
|
34
deploy.sh
34
deploy.sh
@ -65,7 +65,7 @@ fi
|
||||
echo "venv created successfully"
|
||||
|
||||
# activate the virtual environment
|
||||
|
||||
source "$python_exe"
|
||||
|
||||
# install the required packages
|
||||
echo "Installing the required packages"
|
||||
@ -79,24 +79,24 @@ echo "Creating the systemd service"
|
||||
# shellcheck disable=SC2002
|
||||
id=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
|
||||
|
||||
#bash -c "cat <<EOF > /etc/systemd/system/server-status-client.service
|
||||
#[Unit]
|
||||
#Description=Server Status Client
|
||||
#After=network-online.target
|
||||
#
|
||||
#[Service]
|
||||
#Type=simple
|
||||
#ExecStart=$install_dir/server-status-client/venv/bin/python main.py $server $token $id run -n $hostname --labels $labels --location $location
|
||||
#WorkingDirectory=$install_dir/server-status-client
|
||||
#Restart=on-failure
|
||||
#RestartSec=10
|
||||
#
|
||||
#[Install]
|
||||
#WantedBy=multi-user.target
|
||||
#EOF"
|
||||
bash -c "cat <<EOF > /etc/systemd/system/server-status-client.service
|
||||
[Unit]
|
||||
Description=Server Status Client
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=$install_dir/server-status-client/venv/bin/python main.py $server $token $id run -n $hostname --labels $labels --location $location
|
||||
WorkingDirectory=$install_dir/server-status-client
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF"
|
||||
|
||||
# enable and start the service
|
||||
systemctl enable server-status-client
|
||||
systemctl start server-status-client
|
||||
|
||||
echo "server-status-client installed successfully"
|
||||
echo "server-status-client installed successfully"
|
Loading…
Reference in New Issue
Block a user