CIVI_DEMO_DIR=
# Define drupal-db-name and pristine path along with file-name
-DRUPAL_DEMO_DBNAME=
-DRUPAL_DEMO_PRISTINE=
+DRUPAL_DEMO_CRM_DBNAME=
+DRUPAL_DEMO_CRM_PRISTINE=
# Define wordpress-db-name and pristine path along with file-name
-WORDPRESS_DEMO_DBNAME=
-WORDPRESS_DEMO_PRISTINE=
+WORDPRESS_DEMO_CRM_DBNAME=
+WORDPRESS_DEMO_CRM_PRISTINE=
# Define wordpress-db-name and pristine path along with file-name
JOOMLA_DEMO_DBNAME=
--- /dev/null
+#!/usr/bin/env /bin/bash
+
+source `dirname $0`/demo.conf
+
+pushd .
+
+# load drupal demo pristines
+if [ $DRUPAL_DEMO_CRM_DBNAME ]; then
+ mysqladmin -f drop $DRUPAL_DEMO_CRM_DBNAME
+ echo "Creating civicrm-drupal-demo db.."
+ mysqladmin create $DRUPAL_DEMO_CRM_DBNAME
+ if [ -f $DRUPAL_DEMO_CRM_PRISTINE ]; then
+ echo "Reloading civicrm-drupal-demo db from pristine.."
+ mysql $DRUPAL_DEMO_CRM_DBNAME < $DRUPAL_DEMO_CRM_PRISTINE
+ fi
+fi
+
+if [ $DRUPAL_DEMO_CMS_DBNAME ]; then
+ mysqladmin -f drop $DRUPAL_DEMO_CMS_DBNAME
+ echo "Creating drupal-demo db.."
+ mysqladmin create $DRUPAL_DEMO_CMS_DBNAME
+ if [ -f $DRUPAL_DEMO_CMS_PRISTINE ]; then
+ echo "Reloading drupal-demo db from pristine.."
+ mysql $DRUPAL_DEMO_CMS_DBNAME < $DRUPAL_DEMO_CMS_PRISTINE
+ fi
+fi
+
+popd
if [ $JOOMLA_DEMO_DBNAME ]; then
if [ -f $JOOMLA_DEMO_PRISTINE ]; then
mysqladmin -f drop $JOOMLA_DEMO_DBNAME
+ echo "Creating civicrm-joomla-demo db.."
mysqladmin create $JOOMLA_DEMO_DBNAME
echo "Reloading civicrm-joomla-demo from pristine.."
mysql $JOOMLA_DEMO_DBNAME < $JOOMLA_DEMO_PRISTINE
pushd .
-if [ $WORDPRESS_DEMO_DBNAME ]; then
- # wordpress pristine
- if [ -f $WORDPRESS_DEMO_PRISTINE ]; then
- mysqladmin -f drop $WORDPRESS_DEMO_DBNAME
+# load wordpress demo pristines
+if [ $WORDPRESS_DEMO_CRM_DBNAME ]; then
+ mysqladmin -f drop $WORDPRESS_DEMO_CRM_DBNAME
+ echo "Creating civicrm-wordpress-demo db.."
+ mysqladmin create $WORDPRESS_DEMO_CRM_DBNAME
+ if [ -f $WORDPRESS_DEMO_CRM_PRISTINE ]; then
echo "Reloading civicrm-wordpress-demo db from pristine.."
- mysqladmin create $WORDPRESS_DEMO_DBNAME
- mysql $WORDPRESS_DEMO_DBNAME < $WORDPRESS_DEMO_PRISTINE
+ mysql $WORDPRESS_DEMO_CRM_DBNAME < $WORDPRESS_DEMO_CRM_PRISTINE
+ fi
+fi
+
+if [ $WORDPRESS_DEMO_CMS_DBNAME ]; then
+ mysqladmin -f drop $WORDPRESS_DEMO_CMS_DBNAME
+ echo "Creating wordpress-demo db.."
+ mysqladmin create $WORDPRESS_DEMO_CMS_DBNAME
+ if [ -f $WORDPRESS_DEMO_CMS_PRISTINE ]; then
+ echo "Reloading wordpress-demo db from pristine.."
+ mysql $WORDPRESS_DEMO_CMS_DBNAME < $WORDPRESS_DEMO_CMS_PRISTINE
fi
fi
--- /dev/null
+#!/usr/bin/env /bin/bash
+
+source `dirname $0`/demo.conf
+
+pushd .
+
+# drupal pristine
+if [ "$1" == "cms" ] && [ $DRUPAL_DEMO_CMS_DBNAME ]; then
+ echo "Creating drupal-demo db dump.."
+ mysqldump $DRUPAL_DEMO_CMS_DBNAME > $TMP_DUMP_FILE
+ if [ -f $DRUPAL_DEMO_CMS_PRISTINE ]; then
+ echo "Creating drupal-demo db pristine from dump.."
+ cp $TMP_DUMP_FILE $DRUPAL_DEMO_CMS_PRISTINE
+ fi
+elif [ -z "$1" ] && [ $DRUPAL_DEMO_CRM_DBNAME ]; then
+ echo "Creating civicrm-drupal-demo db dump.."
+ mysqldump $DRUPAL_DEMO_CRM_DBNAME > $TMP_DUMP_FILE
+ if [ -f $DRUPAL_DEMO_CRM_PRISTINE ]; then
+ echo "Creating civicrm-drupal-demo db pristine from dump.."
+ cp $TMP_DUMP_FILE $DRUPAL_DEMO_CRM_PRISTINE
+ fi
+else
+ echo "Sorry i couldn't do anything.."
+fi
+
+popd
pushd .
-# creating wordpress pristine
-if [ $WORDPRESS_DEMO_DBNAME ]; then
- if [ -f $WORDPRESS_DEMO_PRISTINE ]; then
- echo "Taking civicrm-wordpress-demo db dump.."
- mysqldump $WORDPRESS_DEMO_DBNAME > $TMP_DUMP_FILE
- echo "Creating civicrm-wordpress-demo pristine from dump.."
- cp $TMP_DUMP_FILE $WORDPRESS_DEMO_PRISTINE
+# wordpress pristine
+if [ "$1" == "cms" ] && [ $WORDPRESS_DEMO_CMS_DBNAME ]; then
+ echo "Creating wordpress-demo db dump.."
+ mysqldump $WORDPRESS_DEMO_CMS_DBNAME > $TMP_DUMP_FILE
+ if [ -f $WORDPRESS_DEMO_CMS_PRISTINE ]; then
+ echo "Creating wordpress-demo db pristine from dump.."
+ cp $TMP_DUMP_FILE $WORDPRESS_DEMO_CMS_PRISTINE
fi
+elif [ -z "$1" ] && [ $WORDPRESS_DEMO_CRM_DBNAME ]; then
+ echo "Creating civicrm-wordpress-demo db dump.."
+ mysqldump $WORDPRESS_DEMO_CRM_DBNAME > $TMP_DUMP_FILE
+ if [ -f $WORDPRESS_DEMO_CRM_PRISTINE ]; then
+ echo "Creating civicrm-wordpress-demo db pristine from dump.."
+ cp $TMP_DUMP_FILE $WORDPRESS_DEMO_CRM_PRISTINE
+ fi
+else
+ echo "Sorry i couldn't do anything.."
fi
popd
echo "cd $CIVI_DEMO_DIR/sql"
cd $CIVI_DEMO_DIR/sql
-if [ $DRUPAL_DEMO_DBNAME ]; then
+if [ $DRUPAL_DEMO_CRM_DBNAME ]; then
# drupal pristine
echo "Reloading civicrm-drupal-demo db from generated.mysql .."
- mysqladmin -f drop $DRUPAL_DEMO_DBNAME
- mysqladmin create $DRUPAL_DEMO_DBNAME
- mysql $DRUPAL_DEMO_DBNAME < civicrm.mysql
- mysql $DRUPAL_DEMO_DBNAME < civicrm_generated.mysql
+ mysqladmin -f drop $DRUPAL_DEMO_CRM_DBNAME
+ mysqladmin create $DRUPAL_DEMO_CRM_DBNAME
+ mysql $DRUPAL_DEMO_CRM_DBNAME < civicrm.mysql
+ mysql $DRUPAL_DEMO_CRM_DBNAME < civicrm_generated.mysql
echo "Taking civicrm-drupal-demo dump.."
- mysqldump $DRUPAL_DEMO_DBNAME > $TMP_DUMP_FILE
- if [ -f $DRUPAL_DEMO_PRISTINE ]; then
+ mysqldump $DRUPAL_DEMO_CRM_DBNAME > $TMP_DUMP_FILE
+ if [ -f $DRUPAL_DEMO_CRM_PRISTINE ]; then
echo "Creating civicrm-drupal-demo pristine.."
- cp $TMP_DUMP_FILE $DRUPAL_DEMO_PRISTINE
+ cp $TMP_DUMP_FILE $DRUPAL_DEMO_CRM_PRISTINE
fi
fi
exit 1
fi
-if [ $WORDPRESS_DEMO_DBNAME ]; then
+if [ $WORDPRESS_DEMO_CRM_DBNAME ]; then
# wordpress pristine
- if [ -f $WORDPRESS_DEMO_PRISTINE ]; then
+ if [ -f $WORDPRESS_DEMO_CRM_PRISTINE ]; then
echo "Creating civicrm-wordpress-demo pristine.."
- cp $TMP_DUMP_FILE $WORDPRESS_DEMO_PRISTINE
+ cp $TMP_DUMP_FILE $WORDPRESS_DEMO_CRM_PRISTINE
fi
- mysqladmin -f drop $WORDPRESS_DEMO_DBNAME
+ mysqladmin -f drop $WORDPRESS_DEMO_CRM_DBNAME
echo "Reloading civicrm-wordpress-demo from pristine.."
- mysqladmin create $WORDPRESS_DEMO_DBNAME
- mysql $WORDPRESS_DEMO_DBNAME < $TMP_DUMP_FILE
+ mysqladmin create $WORDPRESS_DEMO_CRM_DBNAME
+ mysql $WORDPRESS_DEMO_CRM_DBNAME < $TMP_DUMP_FILE
fi
if [ $JOOMLA_DEMO_DBNAME ]; then