move scanip from cmdline to config
This commit is contained in:
parent
6561a77d6d
commit
4e979d76a3
@ -36,7 +36,7 @@ func main() {
|
||||
}
|
||||
defer cfg.Db.Close()
|
||||
|
||||
if !cfg.Switchs.NoScanIP {
|
||||
if cfg.Options.ScanIP {
|
||||
go models.ScanIP(&cfg)
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,6 @@ func (cfg *Config) GetConfig() error {
|
||||
var init bool
|
||||
var port int
|
||||
var version bool
|
||||
var noscanip bool
|
||||
var migrate bool
|
||||
|
||||
flag.Usage = utils.Usage
|
||||
@ -24,7 +23,6 @@ func (cfg *Config) GetConfig() error {
|
||||
flag.BoolVar(&drop, "drop", false, "If dropping tables must occur")
|
||||
flag.BoolVar(&init, "init", false, "If init of database must be done")
|
||||
flag.BoolVar(&version, "version", false, "Show version")
|
||||
flag.BoolVar(&noscanip, "noscanip", false, "Do not run scanip")
|
||||
flag.BoolVar(&migrate, "migrate", false, "Do migrations on version changes")
|
||||
|
||||
flag.Parse()
|
||||
@ -33,7 +31,6 @@ func (cfg *Config) GetConfig() error {
|
||||
cfg.Switchs.Init = init
|
||||
cfg.Switchs.Port = port
|
||||
cfg.Switchs.Version = version
|
||||
cfg.Switchs.NoScanIP = noscanip
|
||||
cfg.Switchs.Migrate = migrate
|
||||
|
||||
var inicfg, err = ini.Load(configfile)
|
||||
@ -51,6 +48,7 @@ func (cfg *Config) GetConfig() error {
|
||||
cfg.Options.SocketChannel = "ipbl"
|
||||
cfg.Options.HideBanner = ipblsection.Key("hidebanner").MustBool(false)
|
||||
cfg.Options.Debug = ipblsection.Key("debug").MustBool(false)
|
||||
cfg.Options.ScanIP = ipblsection.Key("scanip").MustBool(false)
|
||||
|
||||
return nil
|
||||
}
|
||||
@ -68,6 +66,7 @@ type Config struct {
|
||||
HideBanner bool
|
||||
SocketChannel string
|
||||
Debug bool
|
||||
ScanIP bool
|
||||
}
|
||||
Switchs struct {
|
||||
Port int
|
||||
@ -75,7 +74,6 @@ type Config struct {
|
||||
Drop bool
|
||||
Init bool
|
||||
Version bool
|
||||
NoScanIP bool
|
||||
Migrate bool
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user