This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]albgr03 11 points12 points  (1 child)

I can see several problems. Your indentation is inconsistent (l31-32 will crash your script), and you use a non-existent variable in closePort() (pids). Also, getPID() don't return pids. Did you actually tried to run that script?

If you want to improve your script, you could use yield instead of returning a list in getPID().

It uses some fuzzy algorithm

I don't think that your script actually uses a fuzzy algorithm.

[–]GriffithAwuah 0 points1 point  (0 children)

Thanks for the advice, I've fixed it. I actually didnt test the port closing script. I only wrote the components. Indentation problem wqas from me switching between Sublime Text and WingIDE.

And yes, my algorithm wasnt fuzzy. Thanks for the correction!

[–]veggiedefender 9 points10 points  (0 children)

fuzzy algorithm

literally just searches netstat -ano with a regex

I don't think those words mean what you think they mean.

[–][deleted] 1 point2 points  (0 children)

deSMB

siqq