scripts\install_systemd.sh shutdown.sh start.sh

This commit is contained in:
wnlen
2026-01-15 13:49:23 +08:00
parent 0e1bf1d230
commit f8b6c8cea6
3 changed files with 39 additions and 22 deletions

View File

@ -51,20 +51,17 @@ chown -R "$Service_User:$Service_Group" \
cat >"$Unit_Path"<<EOF
[Unit]
Description=Clash for Linux
After=network.target
Wants=network.target
After=network-online.target
Wants=network-online.target
[Service]
Type=forking
Type=simple
WorkingDirectory=$Server_Dir
# 启动 / 停止
ExecStart=/bin/bash $Server_Dir/start.sh
ExecStop=/bin/bash $Server_Dir/shutdown.sh
# PID 管理
PIDFile=$PID_FILE
# 失败策略
Restart=on-failure
RestartSec=5