File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,9 @@ get_option () {
5
5
local section=$1
6
6
local option=$2
7
7
local default=$3
8
- ret=$( my_print_defaults $section | grep ' ^--' ${option} ' =' | cut -d= -f2-)
8
+ # my_print_defaults can output duplicates, if an option exists both globally and in
9
+ # a custom config file. We pick the last occurence, which is from the custom config.
10
+ ret=$( my_print_defaults $section | grep ' ^--' ${option} ' =' | cut -d= -f2- | tail -n1)
9
11
[ -z $ret ] && ret=$default
10
12
echo $ret
11
13
}
Original file line number Diff line number Diff line change @@ -5,7 +5,9 @@ get_option () {
5
5
local section=$1
6
6
local option=$2
7
7
local default=$3
8
- ret=$( my_print_defaults $section | grep ' ^--' ${option} ' =' | cut -d= -f2-)
8
+ # my_print_defaults can output duplicates, if an option exists both globally and in
9
+ # a custom config file. We pick the last occurence, which is from the custom config.
10
+ ret=$( my_print_defaults $section | grep ' ^--' ${option} ' =' | cut -d= -f2- | tail -n1)
9
11
[ -z $ret ] && ret=$default
10
12
echo $ret
11
13
}
Original file line number Diff line number Diff line change @@ -5,7 +5,9 @@ get_option () {
5
5
local section=$1
6
6
local option=$2
7
7
local default=$3
8
- ret=$( my_print_defaults $section | grep ' ^--' ${option} ' =' | cut -d= -f2-)
8
+ # my_print_defaults can output duplicates, if an option exists both globally and in
9
+ # a custom config file. We pick the last occurence, which is from the custom config.
10
+ ret=$( my_print_defaults $section | grep ' ^--' ${option} ' =' | cut -d= -f2- | tail -n1)
9
11
[ -z $ret ] && ret=$default
10
12
echo $ret
11
13
}
@@ -77,6 +79,7 @@ if [ "$1" = 'mysqld' ]; then
77
79
echo ' FLUSH PRIVILEGES ;' >> " $tempSqlFile "
78
80
79
81
mysql -uroot < " $tempSqlFile "
82
+
80
83
rm -f " $tempSqlFile "
81
84
kill $( cat $PIDFILE )
82
85
for i in $( seq 30 -1 0) ; do
@@ -95,4 +98,3 @@ if [ "$1" = 'mysqld' ]; then
95
98
fi
96
99
97
100
exec " $@ "
98
-
You can’t perform that action at this time.
0 commit comments