Files
vulhub/base/jimureport/1.6.0/docker-entrypoint.sh
Aaron 63285f61aa
Some checks failed
Vulhub Format Check and Lint / format-check (push) Has been cancelled
Vulhub Format Check and Lint / markdown-check (push) Has been cancelled
Vulhub Docker Image CI / longtime-images-test (push) Has been cancelled
Vulhub Docker Image CI / images-test (push) Has been cancelled
first commit
2025-09-06 16:08:15 +08:00

18 lines
751 B
Bash

#!/bin/bash
set -ex
echo "Waiting for database to start..."
while ! mysqladmin ping -h "${MYSQL_HOST:-127.0.0.1}" -P "${MYSQL_PORT:-3306}" -u"${MYSQL_USERNAME:-root}" -p"${MYSQL_PASSWORD:-root}" --silent; do
sleep 1
done
if ! mysql -h "${MYSQL_HOST:-127.0.0.1}" -P "${MYSQL_PORT:-3306}" -u"${MYSQL_USERNAME:-root}" -p"${MYSQL_PASSWORD:-root}" -D "${MYSQL_DB:-jimureport}" -e 'describe jimu_dict;' > /dev/null 2>&1; then
echo "database does not exist, initializing..."
mysql -h "${MYSQL_HOST:-127.0.0.1}" -P "${MYSQL_PORT:-3306}" -u"${MYSQL_USERNAME:-root}" -p"${MYSQL_PASSWORD:-root}" -D "${MYSQL_DB:-jimureport}" < /opt/jimureport/jimureport.mysql5.7.create.sql
else
echo "database have already initialized, skip..."
fi
exec "$@"