Disale local IP module if no ip is available

This commit is contained in:
2026-02-15 19:42:18 +02:00
parent 637bd2c3e3
commit 738d2c2086
+5
View File
@@ -358,6 +358,11 @@ func initializeModuleMap() {
localIpModule := StormfetchModule{stormfetchModuleConfig: stormfetchModuleConfig{Name: "local_ip", Format: "%3Local IP: %4$LOCAL_IP"}, Execute: func(sm StormfetchModule) string {
localIP := GetLocalIP()
// Return empty string if local IP is unavailable
if localIP == "Unknown" {
return ""
}
return os.Expand(sm.Format, func(s string) string {
switch s {
case "LOCAL_IP":