Skip to content

Make get_option() handle duplicate options in my_print_defaults output #75

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 30, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion 5.5/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ get_option () {
local section=$1
local option=$2
local default=$3
ret=$(my_print_defaults $section | grep '^--'${option}'=' | cut -d= -f2-)
# my_print_defaults can output duplicates, if an option exists both globally and in
# a custom config file. We pick the last occurence, which is from the custom config.
ret=$(my_print_defaults $section | grep '^--'${option}'=' | cut -d= -f2- | tail -n1)
[ -z $ret ] && ret=$default
echo $ret
}
Expand Down
4 changes: 3 additions & 1 deletion 5.6/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ get_option () {
local section=$1
local option=$2
local default=$3
ret=$(my_print_defaults $section | grep '^--'${option}'=' | cut -d= -f2-)
# my_print_defaults can output duplicates, if an option exists both globally and in
# a custom config file. We pick the last occurence, which is from the custom config.
ret=$(my_print_defaults $section | grep '^--'${option}'=' | cut -d= -f2- | tail -n1)
[ -z $ret ] && ret=$default
echo $ret
}
Expand Down
6 changes: 4 additions & 2 deletions 5.7/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ get_option () {
local section=$1
local option=$2
local default=$3
ret=$(my_print_defaults $section | grep '^--'${option}'=' | cut -d= -f2-)
# my_print_defaults can output duplicates, if an option exists both globally and in
# a custom config file. We pick the last occurence, which is from the custom config.
ret=$(my_print_defaults $section | grep '^--'${option}'=' | cut -d= -f2- | tail -n1)
[ -z $ret ] && ret=$default
echo $ret
}
Expand Down Expand Up @@ -77,6 +79,7 @@ if [ "$1" = 'mysqld' ]; then
echo 'FLUSH PRIVILEGES ;' >> "$tempSqlFile"

mysql -uroot < "$tempSqlFile"

rm -f "$tempSqlFile"
kill $(cat $PIDFILE)
for i in $(seq 30 -1 0); do
Expand All @@ -95,4 +98,3 @@ if [ "$1" = 'mysqld' ]; then
fi

exec "$@"