Merge pull request #19 from Adlyq/Alpha-pr

[skip ci]Only prompt when interface cannot be found
This commit is contained in:
Meta 2022-03-18 21:45:50 +08:00 committed by GitHub
commit c8b1050c15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -913,7 +913,9 @@ func parseTun(rawTun RawTun, general *General) (*Tun, error) {
if (rawTun.Enable || general.TProxyPort != 0) && general.Interface == "" {
autoDetectInterfaceName, err := commons.GetAutoDetectInterface()
if err != nil || autoDetectInterfaceName == "" {
return nil, fmt.Errorf("can not find auto detect interface: %w. you must be detect `interface-name` if tun set to enable or `tproxy-port` isn't zore", err)
log.Warnln("Can not find auto detect interface.[%s]", err)
} else {
log.Warnln("Auto detect interface: %s", autoDetectInterfaceName)
}
general.Interface = autoDetectInterfaceName