Files
mailcat/bin/status_mailcat.sh
2026-07-20 20:49:36 +02:00

19 lines
420 B
Bash
Executable File

#!/bin/sh
set -eu
PID_FILE="/share/homes/mailcat/mailcat/run/mailcat.pid"
LOG_DIR="/share/homes/mailcat/mailcat/log"
if [ -f "$PID_FILE" ]; then
pid=""
IFS= read -r pid < "$PID_FILE" || true
if [ -n "$pid" ] && kill -0 "$pid" 2>/dev/null; then
echo "mailcat running: $pid"
exit 0
fi
echo "mailcat not running: stale pid file ($pid)"
exit 1
fi
echo "mailcat not running"
echo "logs: $LOG_DIR"
exit 1