Files
Fnos-Havline/havline/cmd/main
T

30 lines
420 B
Bash
Executable File

#!/bin/bash
set -u
CONTAINER_NAME="havline"
LOG_FILE="${TRIM_TEMP_LOGFILE:-/dev/stderr}"
log_error() {
echo "$1" > "$LOG_FILE"
}
is_running() {
docker inspect "$CONTAINER_NAME" 2>/dev/null | grep -q '"Status": "running"'
}
case "${1:-}" in
start|stop)
exit 0
;;
status)
if is_running; then
exit 0
fi
exit 3
;;
*)
log_error "Unknown command: ${1:-}"
exit 1
;;
esac