测试
This commit is contained in:
parent
de29bc292a
commit
e9aa100cb8
9
tap.go
9
tap.go
|
@ -96,13 +96,16 @@ func (nc *NetCard) Run() {
|
|||
// go nc.cli.run()
|
||||
time.Sleep(time.Second)
|
||||
|
||||
log.Printf("ip addr add %s dev stap", config.Network.Self.Virt)
|
||||
cmd := strings.Split(fmt.Sprintf("ip addr add %s dev stap", config.Network.Self.Virt), " ")
|
||||
cmdstr := fmt.Sprintf("ip addr add %s dev stap", config.Network.Self.Virt)
|
||||
log.Println(cmdstr)
|
||||
cmd := strings.Split(cmdstr, " ")
|
||||
err := exec.Command(cmd[0], cmd[1:]...).Run()
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
cmd = strings.Split("ip link set dev stap up", " ")
|
||||
|
||||
cmdstr = "ip link set dev stap up"
|
||||
cmd = strings.Split(cmdstr, " ")
|
||||
err = exec.Command(cmd[0], cmd[1:]...).Run()
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
|
|
Loading…
Reference in New Issue
Block a user