services
This commit is contained in:
24
templates/squashkiwi/status.sh
Normal file
24
templates/squashkiwi/status.sh
Normal file
@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Source common functions
|
||||
source "$(dirname "$0")/_common.sh"
|
||||
|
||||
# Load environment variables
|
||||
load_env "$1" || exit 1
|
||||
|
||||
# check if the service is running
|
||||
if ! docker ps | grep -q "$CONTAINER_NAME"; then
|
||||
echo "Service is not running"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Service is running"
|
||||
|
||||
# curl -s -X GET http://localhost:8080/health | grep -q "OK"
|
||||
if ! curl -s -X GET http://localhost:${HOST_PORT}/health | grep -q "OK"; then
|
||||
echo "Service is not healthy"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Service is healthy"
|
||||
return 0
|
Reference in New Issue
Block a user