Files
http_logger/bin/stop.sh
Vladimir V Maksimov 9361880b33 Initial commit
2025-10-26 02:03:14 +03:00

31 lines
631 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/sh
APP_NAME="http_logger"
if [ -z "$APP_NAME" ]; then
echo "Usage: $0 <app_name>"
exit 1
fi
# Найти PID по имени процесса
PIDS=$(pgrep -f "$APP_NAME")
if [ -z "$PIDS" ]; then
echo "Процесс с именем '$APP_NAME' не найден."
exit 0
fi
echo "Найден PID: $PIDS"
for PID in $PIDS; do
echo "Отправка SIGTERM процессу $PID..."
kill "$PID"
printf "Ожидание завершения процесса %s" "$PID"
while kill -0 "$PID" 2>/dev/null; do
printf "."
sleep 1
done
echo ""
echo "Процесс $PID завершён."
done