Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
stop running lsof with sudo by default
Browse files Browse the repository at this point in the history
  • Loading branch information
pirate committed Nov 9, 2016
1 parent 74d7bab commit 9499b1a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sources/sockets.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os

FAST_CMD = "netstat -tan | grep '[:.]{0}' | grep '{1}'"
LSOF_CMD = "sudo lsof +c 0 -i:{0} | grep -v '^launchd ' | grep '{1}'"
LSOF_CMD = "lsof +c 0 -i:{0} | grep -v '^launchd ' | grep '{1}'" # ideally this should be with sudo

def get_details(port, state='ESTABLISHED'):
get_conn_details = LSOF_CMD.format(port, state or '.*')
Expand Down

0 comments on commit 9499b1a

Please sign in to comment.