2024-07-03 16:27:03 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2024-12-16 15:19:18 +00:00
|
|
|
if [[ ( $IMMICH_WORKERS_INCLUDE != '' && $IMMICH_WORKERS_INCLUDE != *api* ) || $IMMICH_WORKERS_EXCLUDE == *api* ]]; then
|
|
|
|
echo "API worker excluded, skipping";
|
|
|
|
exit 0;
|
|
|
|
fi
|
|
|
|
|
|
|
|
IMMICH_HOST="${IMMICH_HOST:-localhost}"
|
|
|
|
IMMICH_PORT="${IMMICH_PORT:-2283}"
|
|
|
|
|
|
|
|
result=$(curl -fsS -m 2 http://"$IMMICH_HOST":"$IMMICH_PORT"/api/server/ping)
|
|
|
|
result_exit=$?
|
|
|
|
|
|
|
|
if [ $result_exit != 0 ]; then
|
|
|
|
echo "Fail: exit code is $result_exit";
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$result" != "{\"res\":\"pong\"}" ]; then
|
|
|
|
echo "Fail: didn't reply with pong";
|
|
|
|
exit 1;
|
|
|
|
fi
|