Missed sudo on ps, might be redundant but couldn't hurt

pull/350/head
Colin Kuebler 2019-10-30 15:11:25 -04:00
parent 17525e94f6
commit 322e42514f
1 changed files with 1 additions and 1 deletions

View File

@ -53,7 +53,7 @@ check_port () {
echo -n "Checking ${protocol^^} port $port... "
process_pid=$(sudo ss -Hlnp -A "$protocol" "sport = :$port" | grep -Po "(?<=pid=)(\d+)" | head -n1)
if [ -n "$process_pid" ]; then
process_name=$(ps -p "$process_pid" -o comm=)
process_name=$(sudo ps -p "$process_pid" -o comm=)
echo "Occupied by $process_name with PID $process_pid."
echo "Port $port is needed to $reason"
read -p "Do you wish to terminate $process_name? [y/N] " -n 1 -r