#!/bin/sh

mysql -u root -p <<!
drop database liferay;
drop user 'liferay'@'localhost';
create database liferay;
CREATE USER 'liferay'@'localhost' IDENTIFIED BY 'rayolife';
GRANT ALL PRIVILEGES ON liferay.* TO 'liferay'@'localhost' WITH GRANT OPTION;
!

mkdir -p deploy
cp liferay/bundles/deploy/so-* deploy/
cp liferay/bundles/deploy/opensocial* deploy/
cp liferay/bundles/deploy/chat* deploy/
cp liferay/bundles/deploy/contacts-portlet-6.1.0.1.war deploy/
cp liferay/bundles/deploy/microblogs-portlet-6.1.0.1.war deploy/
cp liferay/bundles/deploy/private-messaging-portlet-6.1.0.1.war deploy/
cp liferay/bundles/deploy/tasks-portlet-6.1.0.1.war deploy/
cp liferay/bundles/deploy/todays-events-portlet-6.1.0.1.war deploy/
cp liferay/bundles/deploy/weather-portlet-6.1.0.1.war deploy/
cp liferay/bundles/deploy/wysiwyg-portlet-6.1.0.1.war deploy/
