#!/usr/bin/env bash # Stop the demo application. # # Note the bracket in the grep pattern: it stops the pattern matching this script's own # process. Match the MAIN CLASS, never 'spring-boot' - that pattern also matches the shell # command line that started the application, so pkill -f 'spring-boot' kills your own shell. set -eu for pid in $(ps -eo pid,cmd | grep '[C]orsCsrfApplication' | awk '{print $1}'); do kill -9 "$pid" 2>/dev/null || true done sleep 1