Files
web-giao-ban-go/stop.sh
T

19 lines
411 B
Bash
Raw Normal View History

#!/bin/bash
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if systemctl is-active --quiet web-giao-ban-go; then
echo "Dừng systemd service web-giao-ban-go..."
sudo systemctl stop web-giao-ban-go
exit 0
fi
PID=$(pgrep -f "$DIR/web-giao-ban" || true)
if [ -n "$PID" ]; then
echo "Đang dừng PID: $PID..."
kill $PID
sleep 1
echo "Đã dừng."
else
echo "Ứng dụng không chạy."
fi