()
| 30 | ) |
| 31 | |
| 32 | func GetLocalIP() string { |
| 33 | cmd := exec.Command("bash", "-c", "/usr/bin/netstat -ie | grep -B1 '10.0.1' | sed -n 2p | tr -s ' ' | cut -d ' ' -f 3") |
| 34 | stdout, err := cmd.Output() |
| 35 | |
| 36 | if err != nil { |
| 37 | logrus.Fatal(err) |
| 38 | } |
| 39 | |
| 40 | ip := string(stdout) |
| 41 | ip = ip[0 : len(ip)-1] |
| 42 | |
| 43 | return ip |
| 44 | } |
no outgoing calls
no test coverage detected