24 lines
503 B
Bash
Executable File
24 lines
503 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
|
|
# shellcheck disable=SC1091
|
|
source "$SCRIPT_DIR/common.sh"
|
|
|
|
if has_systemd_unit; then
|
|
if systemctl is-active --quiet "$SYSTEMD_SERVICE_NAME"; then
|
|
echo "hy-app-monitor running under systemd port=$APP_PORT"
|
|
exit 0
|
|
fi
|
|
echo "hy-app-monitor stopped"
|
|
exit 1
|
|
fi
|
|
|
|
if is_running; then
|
|
echo "hy-app-monitor running pid=$(read_pid) port=$APP_PORT"
|
|
exit 0
|
|
fi
|
|
|
|
echo "hy-app-monitor stopped"
|
|
exit 1
|