Skip to content

Commit 0f22ba7

Browse files
author
Aaron O'Mullan
committed
Support cleaning up MySQL in run_apache.sh
1 parent 6b02cf4 commit 0f22ba7

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

core/cb.project/php/run_apache.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff 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"
151155
function 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

0 commit comments

Comments
 (0)