diff --git a/CHANGELOG.md b/CHANGELOG.md index 6537723..38841c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Change Log All notable changes to this project will be documented in this file. +## [v2.0.2] - 2024-09- +### Fixed +- Error when `IFACES`="" + ## [v2.0.1] - 2024-09-02 ### Added - `Vlans` and `docker0` support [#47](https://github.com/aceberg/WatchYourLAN/issues/47). Thanks [thehijacker](https://github.com/thehijacker)! diff --git a/README.md b/README.md index d139ce9..3ae63ac 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,8 @@ [![Go Report Card](https://goreportcard.com/badge/github.com/aceberg/WatchYourLAN)](https://goreportcard.com/report/github.com/aceberg/WatchYourLAN) [![Maintainability](https://api.codeclimate.com/v1/badges/46b17f99edc1726b5d7d/maintainability)](https://codeclimate.com/github/aceberg/WatchYourLAN/maintainability) ![Docker Image Size (latest semver)](https://img.shields.io/docker/image-size/aceberg/watchyourlan) -![Docker Pulls](https://img.shields.io/docker/pulls/aceberg/watchyourlan) +![GitHub Discussions](https://img.shields.io/github/discussions/aceberg/WatchYourLAN) + Lightweight network IP scanner with web GUI. Features: - Send notification when new host is found diff --git a/internal/arp/arpscan.go b/internal/arp/arpscan.go index 72360de..7a41c8e 100644 --- a/internal/arp/arpscan.go +++ b/internal/arp/arpscan.go @@ -68,17 +68,21 @@ func parseOutput(text, iface string) []models.Host { // Scan all interfaces func Scan(ifaces, args string, strs []string) []models.Host { var text string + var p []string var foundHosts = []models.Host{} arpArgs = args - p := strings.Split(ifaces, " ") + if ifaces != "" { - for _, iface := range p { - slog.Debug("Scanning interface " + iface) - text = scanIface(iface) - slog.Debug("Found IPs: \n" + text) + p = strings.Split(ifaces, " ") - foundHosts = append(foundHosts, parseOutput(text, iface)...) + for _, iface := range p { + slog.Debug("Scanning interface " + iface) + text = scanIface(iface) + slog.Debug("Found IPs: \n" + text) + + foundHosts = append(foundHosts, parseOutput(text, iface)...) + } } for _, s := range strs {