Don't print ps header so no need for grep

pull/350/head
Colin Kuebler 2019-10-30 15:22:43 -04:00
parent 322e42514f
commit 9fa4599024
1 changed files with 1 additions and 1 deletions

View File

@ -63,7 +63,7 @@ check_port () {
exit 1 exit 1
else else
echo "Attempting to terminate $process_name with PID $process_pid" echo "Attempting to terminate $process_name with PID $process_pid"
service=$(sudo ps -p "$process_pid" -o unit | grep service) service=$(sudo ps -p "$process_pid" -o unit=)
if [ -n "$service" ]; then if [ -n "$service" ]; then
sudo systemctl stop "$service" sudo systemctl stop "$service"
else else