Ignore tun config without permission

This commit is contained in:
tom 2024-12-26 21:13:59 +08:00
parent 4f8b382fb3
commit a8378476ba

View File

@ -2,6 +2,7 @@ package inbound
import ( import (
"context" "context"
"errors"
"os" "os"
"sync" "sync"
@ -45,6 +46,11 @@ func (m *Manager) Start(stage adapter.StartStage) error {
m.stage = stage m.stage = stage
for _, inbound := range m.inbounds { for _, inbound := range m.inbounds {
err := adapter.LegacyStart(inbound, stage) err := adapter.LegacyStart(inbound, stage)
if err != nil && errors.Is(err, os.ErrPermission) {
m.Remove(inbound.Tag())
m.logger.Warn("inbound/", inbound.Type(), "[", inbound.Tag(), "]: ", err)
continue
}
if err != nil { if err != nil {
return E.Cause(err, stage, " inbound/", inbound.Type(), "[", inbound.Tag(), "]") return E.Cause(err, stage, " inbound/", inbound.Type(), "[", inbound.Tag(), "]")
} }