add option to stop scanning host after first successful protocol (#242)
This commit is contained in:
parent
d9885ed26c
commit
c3ef8dcd8b
|
@ -46,6 +46,7 @@ func SetOutputFunc(f OutputResultsFunc) {
|
|||
|
||||
func init() {
|
||||
config.Multiple.ContinueOnError = true // set default for multiple value
|
||||
config.Multiple.BreakOnSuccess = false // set default for multiple value
|
||||
}
|
||||
|
||||
var config Config
|
||||
|
|
|
@ -6,6 +6,7 @@ import "errors"
|
|||
type MultipleCommand struct {
|
||||
ConfigFileName string `short:"c" long:"config-file" default:"-" description:"Config filename, use - for stdin"`
|
||||
ContinueOnError bool `long:"continue-on-error" description:"If proceeding protocols error, do not run following protocols (default: true)"`
|
||||
BreakOnSuccess bool `long:"break-on-success" description:"If proceeding protocols succeed, do not run following protocols (default: false)"`
|
||||
}
|
||||
|
||||
// Validate the options sent to MultipleCommand
|
||||
|
|
|
@ -135,6 +135,9 @@ func grabTarget(input ScanTarget, m *Monitor) []byte {
|
|||
if res.Error != nil && !config.Multiple.ContinueOnError {
|
||||
break
|
||||
}
|
||||
if res.Status == SCAN_SUCCESS && config.Multiple.BreakOnSuccess {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
var ipstr string
|
||||
|
|
Loading…
Reference in New Issue