mirror of
https://github.com/EnumeratedDev/stormfetch.git
synced 2026-09-16 07:56:12 +00:00
Disale local IP module if no ip is available
This commit is contained in:
@@ -358,6 +358,11 @@ func initializeModuleMap() {
|
|||||||
localIpModule := StormfetchModule{stormfetchModuleConfig: stormfetchModuleConfig{Name: "local_ip", Format: "%3Local IP: %4$LOCAL_IP"}, Execute: func(sm StormfetchModule) string {
|
localIpModule := StormfetchModule{stormfetchModuleConfig: stormfetchModuleConfig{Name: "local_ip", Format: "%3Local IP: %4$LOCAL_IP"}, Execute: func(sm StormfetchModule) string {
|
||||||
localIP := GetLocalIP()
|
localIP := GetLocalIP()
|
||||||
|
|
||||||
|
// Return empty string if local IP is unavailable
|
||||||
|
if localIP == "Unknown" {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
return os.Expand(sm.Format, func(s string) string {
|
return os.Expand(sm.Format, func(s string) string {
|
||||||
switch s {
|
switch s {
|
||||||
case "LOCAL_IP":
|
case "LOCAL_IP":
|
||||||
|
|||||||
Reference in New Issue
Block a user