#!/usr/bin/env bash # Stops the API started by run.sh --detach. Only processes whose command is "java" match, so # this script can never match (and kill) the shell that is running it. for p in $(ps -eo pid,comm,args | awk '$2 == "java" && /library-management-1.0.0.jar/ {print $1}'); do kill "$p"; done