fix get interface bug

This commit is contained in:
zhouqiu0103 2022-09-15 13:38:14 +08:00
parent 888466c38c
commit ba11a8dea7

View File

@ -163,7 +163,7 @@ func (g *GetInterfaceName) Execute(runtime connector.Runtime) error {
return nil
}
cmd := fmt.Sprintf("ip route "+
"| grep %s "+
"| grep ' %s ' "+
"| sed -e \"s/^.*dev.//\" -e \"s/.proto.*//\"", host.GetAddress())
interfaceName, err := runtime.GetRunner().SudoCmd(cmd, false)
if err != nil {