-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
36 lines (28 loc) · 886 Bytes
/
Copy pathmain.go
File metadata and controls
36 lines (28 loc) · 886 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package main
import (
"flag"
// Remove the log import if it's not used directly in this file
)
func main() {
useConfig := flag.Bool("useConfig", false, "Load settings from config.json")
flag.Parse()
// SetupLogger is called here, but the log package is used within logging.go,
// not directly in main.go
logger := SetupLogger()
if !*useConfig {
logger.Fatal("Configuration required. Use -useConfig to load from config.json.")
}
cfg, err := LoadConfig("configuration/config.json")
if err != nil {
logger.Fatal("Failed to load config: ", err)
}
ips, err := ResolveIPs(cfg)
if err != nil {
logger.Fatal(err)
}
ports, err := ParsePorts(cfg.Ports) // Ensure ParsePorts function is accessible
if err != nil {
logger.Fatal(err)
}
ScanNetwork(ips, ports, cfg.Timeout, logger)
}