测试
This commit is contained in:
parent
dd933f1c8f
commit
dc02f44e14
1
rpc.go
1
rpc.go
|
@ -17,6 +17,7 @@ type RPCServer struct {
|
|||
|
||||
var (
|
||||
serverPort = flag.Int("port", 50051, "The server port")
|
||||
cardIP = flag.String("card", "", "The card ip")
|
||||
othersAddr = flag.String("addr", "", "The other server addr")
|
||||
)
|
||||
|
||||
|
|
3
tap.go
3
tap.go
|
@ -2,6 +2,7 @@ package main
|
|||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log"
|
||||
"os/exec"
|
||||
gen "slimming/proto/gen"
|
||||
|
@ -79,7 +80,7 @@ func (nc *NetCard) Run() {
|
|||
go nc.runWrite()
|
||||
// go nc.cli.run()
|
||||
time.Sleep(time.Second)
|
||||
cmd := strings.Split("ip addr add 10.10.10.10/24 dev stap", " ")
|
||||
cmd := strings.Split(fmt.Sprintf("ip addr add %s/24 dev stap", *cardIP), " ")
|
||||
err := exec.Command(cmd[0], cmd[1:]...).Run()
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
|
|
Loading…
Reference in New Issue
Block a user