Commit b99067bc authored by szh's avatar szh

update

parent 512e69e3
...@@ -56,8 +56,11 @@ func Broadcast() { ...@@ -56,8 +56,11 @@ func Broadcast() {
tlog.Error("broadcast","err","wlan0 not exists") tlog.Error("broadcast","err","wlan0 not exists")
ip,err = util.GetLocalIpByName("eth0") ip,err = util.GetLocalIpByName("eth0")
if err != nil { if err != nil {
panic(err) tlog.Error("broadcast","err","etn0 not exists")
time.Sleep(time.Second*1)
continue
} }
tlog.Info("broadcasr","ip",ip.IP.String())
} }
if runningAddr != nil && runningAddr.IP.String() != ip.IP.String() { if runningAddr != nil && runningAddr.IP.String() != ip.IP.String() {
...@@ -76,6 +79,7 @@ func Broadcast() { ...@@ -76,6 +79,7 @@ func Broadcast() {
tlog.Error("broadcast","net error ",err) tlog.Error("broadcast","net error ",err)
panic(err) panic(err)
} }
tlog.Info("broadcast","oldip",runningAddr.IP.String(),"newip",ip.IP.String())
runningAddr = ip runningAddr = ip
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment