Files
WechatOnCloud/fnos/woc/cmd/main
Gloridust 5c5e9c8540 update
2026-05-29 22:00:23 +08:00

27 lines
571 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# fnOS 应用生命周期入口。Docker 类应用的启停由应用中心直接执行 compose
# 这里 start/stop 只需返回成功status 用首个容器的运行状态代表应用状态。
set -u
COMPOSE_FILE="$(dirname "$0")/../app/docker/docker-compose.yaml"
CONTAINER="woc-panel"
is_running() {
[ "$(docker inspect -f '{{.State.Running}}' "$CONTAINER" 2>/dev/null)" = "true" ]
}
case "${1:-}" in
start)
exit 0
;;
stop)
exit 0
;;
status)
if is_running; then exit 0; else exit 3; fi
;;
*)
exit 0
;;
esac