Filter out units which are not service or the user instance
parent
73a344f043
commit
1b02f66e2c
|
@ -62,7 +62,7 @@ check_port () {
|
|||
echo "Aborting due to occupied port"
|
||||
exit 1
|
||||
else
|
||||
service=$(ps -p "$process_pid" -o unit=)
|
||||
service=$(ps -p "$process_pid" -o unit= | grep .service | grep -Ev ^user)
|
||||
if [ -n "$service" ]; then
|
||||
echo "Attempting to stop $service"
|
||||
sudo systemctl stop "$service"
|
||||
|
|
Loading…
Reference in New Issue