#!/bin/sh

echo "creating main database"
$MYSQL -h$HOST -P$PORT -u$USER -p$PASSWORD <<EOM
CREATE DATABASE ${DB};
EOM
$MYSQL -h$HOST -P$PORT -u$USER -p$PASSWORD ${DB} <create.tables.sql

echo "creating RIPADMIN database"
$MYSQL -h$RIPADMIN_DBHOST -P$RIPADMIN_DBPORT -u$RIPADMIN_DBUSER -p$RIPADMIN_DBPASS <<EOM
CREATE DATABASE ${RIPADMIN_DBNAME};
EOM
$MYSQL -h$RIPADMIN_DBHOST -P$RIPADMIN_DBPORT -u$RIPADMIN_DBUSER -p$RIPADMIN_DBPASS $RIPADMIN_DBNAME <create.RIPADMIN.sql
