#!/bin/sh

status=$(/sbin/e-smith/config getprop mysqld status)
if [ "$status" = "disabled" ]
then
    echo "mysqld is disabled - no tables dumped" >&2
    exit 0
fi
for db in $(mysql -BNre "show databases;")
do
    mysqldump --ignore-table=mysql.event --single-transaction --add-drop-table -QB "$db" -r /home/e-smith/db/mysql/"$db".dump || exit 1
done
