]> git.pld-linux.org Git - packages/mysql.git/commitdiff
move status action to status function
authorElan Ruusamäe <glen@delfi.ee>
Thu, 25 Apr 2013 07:45:21 +0000 (10:45 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Thu, 25 Apr 2013 07:45:21 +0000 (10:45 +0300)
mysql.init

index f5cc30fea348d6dac77846d6547f13dca4e0d3e1..2a1a01d961ebb99da1e97e874bcf9cb20c74700e 100755 (executable)
@@ -622,40 +622,7 @@ condrestart() {
        start
 }
 
-RETVAL=0
-case "$action" in
-  start)
-       start
-       ;;
-  stop)
-       stop
-       ;;
-  restart)
-       stop
-       start
-       ;;
-  try-restart)
-       condrestart 0
-       ;;
-  force-reload)
-       condrestart 7
-       ;;
-  init)
-       for mysqldir in $DB_CLUSTERS; do
-               mysqlinit "$mysqldir"
-       done
-       exit $?
-       ;;
-  flush-logs)
-       for mysqldir in $DB_CLUSTERS; do
-           mysqlgetconfig "$mysqldir"
-               # just if mysqld is really running
-               if /usr/bin/mysqladmin --defaults-file="$MYSQL_CONFIG" --socket="$MYSQL_SOCKET" ping >/dev/null 2>&1; then
-                       /usr/bin/mysqladmin --defaults-file="$MYSQL_CONFIG" --socket="$MYSQL_SOCKET" flush-logs
-               fi
-       done
-       ;;
-  status)
+status() {
        RETVAL=3
        for mysqldir in $DB_CLUSTERS; do
                mysqlstatus "$mysqldir"
@@ -712,6 +679,43 @@ case "$action" in
                        echo
                done
        fi
+}
+
+RETVAL=0
+case "$action" in
+  start)
+       start
+       ;;
+  stop)
+       stop
+       ;;
+  restart)
+       stop
+       start
+       ;;
+  try-restart)
+       condrestart 0
+       ;;
+  force-reload)
+       condrestart 7
+       ;;
+  init)
+       for mysqldir in $DB_CLUSTERS; do
+               mysqlinit "$mysqldir"
+       done
+       exit $?
+       ;;
+  flush-logs)
+       for mysqldir in $DB_CLUSTERS; do
+           mysqlgetconfig "$mysqldir"
+               # just if mysqld is really running
+               if /usr/bin/mysqladmin --defaults-file="$MYSQL_CONFIG" --socket="$MYSQL_SOCKET" ping >/dev/null 2>&1; then
+                       /usr/bin/mysqladmin --defaults-file="$MYSQL_CONFIG" --socket="$MYSQL_SOCKET" flush-logs
+               fi
+       done
+       ;;
+  status)
+       status
        ;;
   *)
        msg_usage "$0 {start|stop|restart|try-restart|force-reload|init|flush-logs|status}"
This page took 0.047636 seconds and 4 git commands to generate.