File tree Expand file tree Collapse file tree 1 file changed +14
-13
lines changed
Expand file tree Collapse file tree 1 file changed +14
-13
lines changed Original file line number Diff line number Diff line change @@ -34,19 +34,20 @@ def scrapeRC():
3434 """
3535 divider = []
3636
37- try :
38- settingsFile = open ("/etc/.searchsploit_rc" , "r" )
39- except :
40- try :
41- settingsFile = open (os .path .expanduser ("~/.searchsploit_rc" ), "r" )
42- except :
43- settingsFile = open (os .path .abspath (
44- os .sys .path [0 ] + "/.searchsploit_rc" ), "r" )
45- # Checks for config in home directory
46-
47- settings = settingsFile .read ().split ("\n " )
48- settingsFile .close ()
49-
37+ paths = [
38+ "/etc/.searchsploit_rc" ,
39+ os .path .expanduser ("~/.searchsploit_rc" ),
40+ os .path .expanduser ("~/.local/.searchsploit_rc" ),
41+ os .path .abspath (os .path .join (os .sys .path [0 ], "/.searchsploit_rc" ))
42+ ]
43+
44+ for p in paths :
45+ if os .path .exists (p ):
46+ with open (p , "r" ) as settingsFile :
47+ settings = settingsFile .read ().split ("\n " )
48+ settingsFile .close ()
49+ break
50+
5051 for i in settings :
5152 if (i == "" or i [0 ] == "#" ):
5253 continue # Ignores lines that are empty or are just comments
You can’t perform that action at this time.
0 commit comments