27 lines
571 B
Plaintext
27 lines
571 B
Plaintext
|
|
#!/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
|