fix: ceci: replace route for darwin
Some checks failed
Coverage CI / build (push) Has been cancelled
CodeQL / Analyze (go) (push) Has been cancelled
Ubuntu CI / build (push) Has been cancelled

This commit is contained in:
Daniel Ding
2025-07-19 08:45:11 +08:00
parent b8e02e71fa
commit b19089559e

View File

@@ -43,6 +43,7 @@ func AddrShow(name string) []string {
}
func RouteAdd(name, prefix, nexthop string, opts ...string) ([]byte, error) {
RouteDel("", prefix, nexthop)
args := []string{"add", "-net", prefix}
if name != "" {
args = append(args, "-iface", name)
@@ -55,7 +56,6 @@ func RouteAdd(name, prefix, nexthop string, opts ...string) ([]byte, error) {
}
func RouteDel(name, prefix, nexthop string, opts ...string) ([]byte, error) {
args := []string{"delete", "-net", prefix}
if name != "" {
args = append(args, "-iface", name)