All checks were successful
continuous-integration/drone/push Build is passing
39 lines
1.2 KiB
Bash
Executable File
39 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
||
|
||
# Скрипт для остановки всех микросервисов Women Safety App
|
||
|
||
# Цвета для вывода
|
||
GREEN="\033[0;32m"
|
||
YELLOW="\033[0;33m"
|
||
RED="\033[0;31m"
|
||
NC="\033[0m" # No Color
|
||
|
||
# Проверка, запущены ли сервисы
|
||
services=("user_service" "emergency_service" "location_service" "calendar_service" "notification_service")
|
||
|
||
for service in "${services[@]}"; do
|
||
pid_file="/tmp/${service}.pid"
|
||
|
||
if [ -f "$pid_file" ]; then
|
||
pid=$(cat "$pid_file")
|
||
if ps -p "$pid" > /dev/null; then
|
||
echo -e "${YELLOW}Остановка ${service}...${NC}"
|
||
kill "$pid"
|
||
rm "$pid_file"
|
||
else
|
||
echo -e "${YELLOW}Сервис ${service} не запущен или PID не найден${NC}"
|
||
rm "$pid_file"
|
||
fi
|
||
else
|
||
echo -e "${YELLOW}PID файл для ${service} не найден${NC}"
|
||
fi
|
||
done
|
||
|
||
# Остановка API Gateway
|
||
gateway_pid=$(lsof -t -i:8000 2>/dev/null)
|
||
if [ -n "$gateway_pid" ]; then
|
||
echo -e "${YELLOW}Остановка API Gateway...${NC}"
|
||
kill "$gateway_pid"
|
||
fi
|
||
|
||
echo -e "${GREEN}✅ Все сервисы остановлены${NC}" |