mirror of https://github.com/daffainfo/nuclei.git
Use random names by default to avoid collision
parent
42b3a5d3e2
commit
9e1e86d89f
|
@ -11,19 +11,14 @@ import (
|
|||
)
|
||||
|
||||
// Default resume file
|
||||
const DefaultResumeFileName = "resume.cfg"
|
||||
const DefaultResumeFileName = "resume-%s.cfg"
|
||||
|
||||
func DefaultResumeFilePath() string {
|
||||
home, err := os.UserHomeDir()
|
||||
if err != nil {
|
||||
return DefaultResumeFileName
|
||||
}
|
||||
resumeFile := filepath.Join(home, ".config", "nuclei", DefaultResumeFileName)
|
||||
|
||||
// Generate random name if already exists
|
||||
if _, err := os.Stat(resumeFile); !os.IsNotExist(err) {
|
||||
resumeFile = filepath.Join(home, ".config", "nuclei", fmt.Sprintf("resume-%s.cfg", xid.New().String()))
|
||||
return fmt.Sprintf("resume-%s.cfg", xid.New().String())
|
||||
}
|
||||
resumeFile := filepath.Join(home, ".config", "nuclei", fmt.Sprintf("resume-%s.cfg", xid.New().String()))
|
||||
return resumeFile
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue