Make no ipv4-addr on iface warn instead of error

dev
Ruakij 2 years ago
parent abe3d0dc33
commit 71de2d376c

@ -59,9 +59,8 @@ func main() {
logger.Error.Fatal(err) logger.Error.Fatal(err)
} }
if(len(addrs) == 0){ if(len(addrs) == 0){
logger.Error.Fatal("Interface doesnt have IPv4-Adresses") logger.Warn.Println("Interface doesnt have IPv4-Adresses")
} } else {
// Add the IPv6 address to the interface // Add the IPv6 address to the interface
ipv6Str := *convertIPv4ToIPv6(&ipv6Format, addrs[0].IPNet) ipv6Str := *convertIPv4ToIPv6(&ipv6Format, addrs[0].IPNet)
ipv6, err := netlink.ParseAddr(ipv6Str) ipv6, err := netlink.ParseAddr(ipv6Str)
@ -78,6 +77,7 @@ func main() {
logger.Error.Fatalf("Failed to set address on interface: %v", err) logger.Error.Fatalf("Failed to set address on interface: %v", err)
} }
} }
}
// Create a WireGuard client // Create a WireGuard client
client, err := wgctrl.New() client, err := wgctrl.New()

Loading…
Cancel
Save