sindresorhus / Actions

⚙️ Supercharge your shortcuts
https://sindresorhus.com/actions
MIT License
2.58k stars 109 forks source link

Action proposal: Close port #128

Open Angelk90 opened 1 year ago

Angelk90 commented 1 year ago

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?

sindresorhus commented 1 year ago

The Actions app is sandboxed, so it's unfortunately not able to execute these commands.