File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import (
10
10
"github.com/jreisinger/checkip"
11
11
)
12
12
13
- var s = flag .Bool ("s " , false , "only print how many checkers consider the ipaddr suspicious " )
13
+ var i = flag .Bool ("i " , false , "run only information checkers" )
14
14
15
15
func main () {
16
16
flag .Parse ()
@@ -47,19 +47,12 @@ func main() {
47
47
"net.IP" : & checkip.IP {},
48
48
}
49
49
50
- if * s {
51
- var checkerSlice []checkip.Checker
52
- for _ , v := range checkers {
53
- checkerSlice = append (checkerSlice , v )
54
- }
55
- n := checkip .Run (checkerSlice , ipaddr )
56
- perc := float64 (n ) / float64 (len (checkers )) * 100.0
57
- fmt .Printf ("%02.0f%% (%d/%d)\n " , perc , n , len (checkers ))
50
+ if * i {
51
+ checkers = infoCheckers
58
52
} else {
59
53
for k , v := range infoCheckers {
60
54
checkers [k ] = v
61
55
}
62
- checkip .RunAndPrint (checkers , ipaddr , "%-25s %s" )
63
56
}
64
-
57
+ checkip . RunAndPrint ( checkers , ipaddr , "%-25s %s" )
65
58
}
You can’t perform that action at this time.
0 commit comments