-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
55 lines (46 loc) · 1.42 KB
/
main.go
File metadata and controls
55 lines (46 loc) · 1.42 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package main
import (
"embed"
"flag"
"fmt"
"os"
"github.com/saschamonteiro/certchecker/internal/app"
)
//go:embed *.tmpl
var Assets embed.FS
var sha1ver string
var buildTime string
func main() {
flag.Usage = func() {
fmt.Fprintf(flag.CommandLine.Output(), "Cert Checker git-sha1:%v buildtime:%v\n", sha1ver, buildTime)
fmt.Fprintf(flag.CommandLine.Output(), "Usage information:\n")
flag.PrintDefaults()
}
cidrAddressList := flag.String("cidr", "192.168.10.0/24,192.168.11.0/24", "network cidr list")
portList := flag.String("ports", "443,636,587,8443", "tcp port list")
skipNoDnsFound := flag.Bool("skipnodns", false, "skip no dns found")
htmlOut := flag.String("html", "", "html output file")
jsonOut := flag.String("json", "", "json output file")
concurrent := flag.Int("conc", 512, "concurrent connections")
debug := flag.Bool("debug", false, "debug")
dialTimeout := flag.Int("t", 3, "dial timeout in seconds")
ver := flag.Bool("v", false, "version")
flag.Parse()
if *ver {
fmt.Printf("version: %s\n", sha1ver)
fmt.Printf("build time: %s\n", buildTime)
os.Exit(0)
}
appProps := app.AppProps{
CidrAddressList: *cidrAddressList,
PortList: *portList,
SkipNoDnsFound: *skipNoDnsFound,
Assets: Assets,
HtmlOut: *htmlOut,
JsonOut: *jsonOut,
Concurrent: *concurrent,
Debug: *debug,
DialTimeout: *dialTimeout,
}
app.StartTlsCollect(appProps)
}