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