Skip to content

Commit

Permalink
Skip setup if they want to get --help or --print-defaults or --version
Browse files Browse the repository at this point in the history
  • Loading branch information
yosifkit committed Feb 25, 2016
1 parent 3ae1837 commit 3288a66
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
13 changes: 12 additions & 1 deletion 5.5/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,18 @@ if [ "${1:0:1}" = '-' ]; then
set -- mysqld "$@"
fi

if [ "$1" = 'mysqld' ]; then
# skip setup if they want an option that stops mysqld
wantHelp=
for arg; do
case "$arg" in
-'?'|--help|--print-defaults|-V|--version)
wantHelp=1
break
;;
esac
done

if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then
# Get config
DATADIR="$("$@" --verbose --help --log-bin-index=`mktemp -u` 2>/dev/null | awk '$1 == "datadir" { print $2; exit }')"

Expand Down
13 changes: 12 additions & 1 deletion 5.6/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,18 @@ if [ "${1:0:1}" = '-' ]; then
set -- mysqld "$@"
fi

if [ "$1" = 'mysqld' ]; then
# skip setup if they want an option that stops mysqld
wantHelp=
for arg; do
case "$arg" in
-'?'|--help|--print-defaults|-V|--version)
wantHelp=1
break
;;
esac
done

if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then
# Get config
DATADIR="$("$@" --verbose --help --log-bin-index=`mktemp -u` 2>/dev/null | awk '$1 == "datadir" { print $2; exit }')"

Expand Down
13 changes: 12 additions & 1 deletion 5.7/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,18 @@ if [ "${1:0:1}" = '-' ]; then
set -- mysqld "$@"
fi

if [ "$1" = 'mysqld' ]; then
# skip setup if they want an option that stops mysqld
wantHelp=
for arg; do
case "$arg" in
-'?'|--help|--print-defaults|-V|--version)
wantHelp=1
break
;;
esac
done

if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then
# Get config
DATADIR="$("$@" --verbose --help 2>/dev/null | awk '$1 == "datadir" { print $2; exit }')"

Expand Down

0 comments on commit 3288a66

Please sign in to comment.