#!/bin/bash

if [ $# -ne 0 ]; then
   for i do
      case "$i" in
      -i | --import)    import=1;      shift;;
      -e | --export)    export=1;      shift;;
      esac
   done
fi

if [ $import -eq 1 ]; then
	cd ../../../../mysql/bin
	echo "import $1"
	./mysql -u root -pmysql $1 < ../../www/EnTrak/EnTrak/Uploads/$1
fi

if [ $export -eq 1 ]; then
	cd ../../../../mysql/bin
	echo "export $1"
	./mysqldump -u root -pmysql $1 > ../../www/EnTrak/EnTrak/Uploads/$1.sql
fi