Fix err on empty IFACES
This commit is contained in:
parent
246b35dbaf
commit
936d4aa312
3 changed files with 16 additions and 7 deletions
|
|
@ -1,6 +1,10 @@
|
||||||
# Change Log
|
# Change Log
|
||||||
All notable changes to this project will be documented in this file.
|
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
|
## [v2.0.1] - 2024-09-02
|
||||||
### Added
|
### Added
|
||||||
- `Vlans` and `docker0` support [#47](https://github.com/aceberg/WatchYourLAN/issues/47). Thanks [thehijacker](https://github.com/thehijacker)!
|
- `Vlans` and `docker0` support [#47](https://github.com/aceberg/WatchYourLAN/issues/47). Thanks [thehijacker](https://github.com/thehijacker)!
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,8 @@
|
||||||
[](https://goreportcard.com/report/github.com/aceberg/WatchYourLAN)
|
[](https://goreportcard.com/report/github.com/aceberg/WatchYourLAN)
|
||||||
[](https://codeclimate.com/github/aceberg/WatchYourLAN/maintainability)
|
[](https://codeclimate.com/github/aceberg/WatchYourLAN/maintainability)
|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Lightweight network IP scanner with web GUI. Features:
|
Lightweight network IP scanner with web GUI. Features:
|
||||||
- Send notification when new host is found
|
- Send notification when new host is found
|
||||||
|
|
|
||||||
|
|
@ -68,17 +68,21 @@ func parseOutput(text, iface string) []models.Host {
|
||||||
// Scan all interfaces
|
// Scan all interfaces
|
||||||
func Scan(ifaces, args string, strs []string) []models.Host {
|
func Scan(ifaces, args string, strs []string) []models.Host {
|
||||||
var text string
|
var text string
|
||||||
|
var p []string
|
||||||
var foundHosts = []models.Host{}
|
var foundHosts = []models.Host{}
|
||||||
arpArgs = args
|
arpArgs = args
|
||||||
|
|
||||||
p := strings.Split(ifaces, " ")
|
if ifaces != "" {
|
||||||
|
|
||||||
for _, iface := range p {
|
p = strings.Split(ifaces, " ")
|
||||||
slog.Debug("Scanning interface " + iface)
|
|
||||||
text = scanIface(iface)
|
|
||||||
slog.Debug("Found IPs: \n" + text)
|
|
||||||
|
|
||||||
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 {
|
for _, s := range strs {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue