Adapter linux client for xinetd

Signed-off-by: Pin <wf6DJd8a3xSSCZbn@protonmail.com>
This commit is contained in:
Pin
2022-04-03 22:02:41 -04:00
parent 6d101ddd9c
commit de9feed536
2 changed files with 28 additions and 4 deletions

View File

@@ -6,7 +6,14 @@ import (
)
func GetAdapter() string {
return "ens160"
inetReturn := ""
inetInterfaces, _ := net.Interfaces()
if inetInterfaces[0].Name == "lo" { // Return second interface if first is loopback
inetReturn = inetInterfaces[1].Name
} else {
inetReturn = inetInterfaces[0].Name
}
return inetReturn
}
func ConnectBack(ip string, connectbackPort string) {