Open babaric-dev opened 7 months ago
netstat -tnlp | grep tinyproxy
This command doesn't work when I am a normal user.
Not sure if you managed to solve this. If not, maybe this solves your issue. The following commands work without the need for elevated privileges
displays tinyproxy port ps aux | grep tinyproxy | grep -v grep | awk '{ print $2 }'
verify that the port is used by tinyproxy ps -p `ps aux | grep tinyproxy | grep -v grep | awk '{ print $2 }'` -o comm=
the second column of ps aux prints process id, not port, at least on my implementation.
I'm working on an automation script involving
tinyproxy
on multiple deployed machines. In my script, I need to check iftinyproxy
is already running and find out the port it's using. If not, start an instance and return the port. However, there's a potential issue: users may have customized theirtinyproxy
configurations, which could interfere with my automation.I would appreciate guidance on how to determine if
tinyproxy
is running and find out the porttinyproxy
is using because I cannot find a reliable way to do so. Thanks in advance.