This commit is contained in:
2026-05-14 13:18:57 +08:00
parent b12b0f0356
commit 58fe23e5ef
7 changed files with 168 additions and 12 deletions

30
service/bird-lgp-alpine Normal file
View File

@@ -0,0 +1,30 @@
#!/sbin/openrc-run
# 服务名称
name="bird-lgproxy"
description="Bird Looking Glass Proxy (Go)"
# 程序路径和参数
command="/etc/birdlg/bird-lgproxy-go"
command_args="-config /etc/birdlg/config.yml"
pidfile="/run/${RC_SVCNAME}.pid"
command_background="yes"
# 自动重启配置(如果程序崩溃)
respawn_delay=5
respawn_max=10
depend() {
# 确保在网络和 bird 启动后再启动
need net
after bird
}
start_pre() {
# 启动前的检查:确保配置文件存在
if [ ! -f "/etc/bird-lg/bird-lgproxy.yaml" ]; then
eerror "Configuration file /etc/bird-lg/bird-lgproxy.yaml not found!"
return 1
fi
}