|
|
|
@ -87,7 +87,17 @@ case "${ACTION}" in
|
|
|
|
|
;;
|
|
|
|
|
"start" | "stop" | "restart")
|
|
|
|
|
APP_NAME="node-red"
|
|
|
|
|
CONTAINER_IDS=$(docker ps -a --filter "ancestor=${APP_NAME}" --format '{{.ID}}')
|
|
|
|
|
CONTAINER_IDS=$(docker ps -a | grep "$APP_NAME" | awk '{print $1}')
|
|
|
|
|
|
|
|
|
|
# Echo action message
|
|
|
|
|
if [ "$ACTION" == "start" ]; then
|
|
|
|
|
echo "Starting $APP_NAME container(s)"
|
|
|
|
|
elif [ "$ACTION" == "stop" ]; then
|
|
|
|
|
echo "Stopping $APP_NAME container(s)"
|
|
|
|
|
elif [ "$ACTION" == "restart" ]; then
|
|
|
|
|
echo "Restarting $APP_NAME container(s)"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
for ID in $CONTAINER_IDS; do
|
|
|
|
|
docker "${ACTION}" "${ID}"
|
|
|
|
|
done
|
|
|
|
|