freebsd-ports/multimedia/mythtv/files/makedb
Greg Lehey ce57b22c43 Perform some post-install stuff: add users and create the mythconverg
database if it doesn't already exist.
2007-01-17 05:52:52 +00:00

23 lines
690 B
Bash

#!/bin/sh
#
# $FreeBSD$
#
# 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