#!/bin/sh
#
# $FreeBSD: ports/multimedia/mythtv/files/makedb,v 1.1 2007/01/17 05:52:52 grog Exp $
#
# Install the MythTV database.  We only do this if it doesn't already
# exist.
#
# Start mysqld if it isn't running.
pgrep mysqld > /dev/null || /usr/local/etc/rc.d/mysql start || exit
# Try to create the database
mysql < /usr/local/share/mythtv/database/mc.sql
if [ $? -ne 0 ]; then
  echo <<EOF
*********************************************************************
Database creation failed.  Please read the output above and create it
manually.  The commands to create the database are in
/usr/local/share/mythtv/database/mc.sql.
*********************************************************************
EOF
  else
    echo <<EOF
Created database mythconverg.  
EOF
