Actions
Actions copied to clipboard
Action proposal: Close port
Description
It would be useful, to know which ports are active and if you click on that port you close it.
I tried doing something similar to get a list of ports:
netstat -Watnlv | grep LISTEN | awk '{"ps -ww -o args= -p " $9 | getline procname; print $4 }' | grep '[*]' | sort -u | sed "s/*.//"
Then via this output, you should create a choice menu that clicking closes the door.
sudo lsof -t -i tcp:Port | sudo xargs kill
@sindresorhus : Do you think it could be useful?
The Actions app is sandboxed, so it's unfortunately not able to execute these commands.