#!/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