| 332 | Wants=network-online.target |
| 333 | After=network-online.target |
| 334 | Documentation=https://github.com/fscarmen/warp-sh |
| 335 | Documentation=https://github.com/pufferffish/wireproxy |
| 336 | |
| 337 | [Service] |
| 338 | ExecStart=${WIREPROXY_BINARY} -c ${WIREPROXY_CONFIG_FILE} |
| 339 | RemainAfterExit=yes |
| 340 | Restart=always |
| 341 | RestartSec=3 |
| 342 | |
| 343 | [Install] |
| 344 | WantedBy=multi-user.target`; |
| 345 | } |
| 346 | |
| 347 | static async stop(): Promise<string> { |
| 348 | try { |
| 349 | await execAsync("sudo systemctl stop wireproxy || true"); |
| 350 | await execAsync("sudo systemctl disable wireproxy || true"); |
| 351 | return "✅ wireproxy 已停止"; |
| 352 | } catch (e: any) { |
| 353 | return `❌ wireproxy 停止失败: ${htmlEscape(e?.message || e)}`; |