mirror of
https://github.com/wnlen/clash-for-linux.git
synced 2026-02-04 10:11:28 +08:00
scripts\install_systemd.sh shutdown.sh start.sh
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user