File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -112,6 +112,10 @@ function start_mysql() {
112112 if [ -z " $( which mysqld) " ]; then
113113 echo " Could not start MySQL because it is not installed on the system's \$ PATH"
114114 fi
115+
116+ # Specify that MySQL was started by this script
117+ # And thus we handle it's termination
118+ MYSQL_STARTED=true
115119
116120 echo " MySQL RUNNING = $( is_mysql_running) "
117121 # Check if MySQL is already running
@@ -150,9 +154,10 @@ function start_mysql() {
150154# Stop MySQL started by "start_mysql"
151155function stop_mysql() {
152156 echo " Killing MySQL"
157+
153158 # MySQL wasn't started by this script
154159 # or is already dead
155- if [ ! ${ MYSQL_STARTED} ] || [ -z " $( is_mysql_running) " ]; then
160+ if [ ! $ MYSQL_STARTED ] || [ -z " $( is_mysql_running) " ]; then
156161 echo " No need to kill MySQL, it is not running"
157162 # So do nothing
158163 return
You can’t perform that action at this time.
0 commit comments