mirror of
https://github.com/prdlk/television.git
synced 2026-11-02 21:22:53 +00:00
22 lines
628 B
TOML
22 lines
628 B
TOML
[metadata]
|
|||
|
|
name = "ports"
|
||
|
|
description = "List listening ports and associated processes"
|
||
|
|
requirements = ["ss", "awk"]
|
||
|
|
|
||
|
|
[source]
|
||
|
|
command = "ss -tlnp 2>/dev/null | tail -n +2 | awk '{gsub(/.*:/,\"\",$4); print $4, $1, $6}' | sed 's/users:((\"//; s/\".*//'"
|
||
|
|
display = "{split: :0} ({split: :2})"
|
||
|
|
|
||
|
|
[preview]
|
||
|
|
command = "ss -tlnp 2>/dev/null | grep ':{split: :0} ' | head -20"
|
||
|
|
|
||
|
|
[ui.preview_panel]
|
||
|
|
border_type = "none"
|
||
|
|
scrollbar = false
|
||
|
|
padding = { left = 2, right = 1, top = 0, bottom = 0 }
|
||
|
|
size = 40
|
||
|
|
|
||
|
|
[actions.kill]
|
||
|
|
description = "Kill the process listening on the selected port"
|
||
|
|
command = "fuser -k {split: :0}/tcp"
|
||
|
|
mode = "execute"
|