#!/bin/bash

if [[ $1 == '' ]] || [[ $2 == '' ]]
  then
    echo "You must specify login and password"
    exit 1
  fi


LOGIN=$1  
PASS=$2 

echo "set eltex_ems"
pv ./eltex_ems.sql | mysql -u$LOGIN -p$PASS eltex_ems
echo "set eltex_ems"
pv ./acsmain.sql | mysql -u$LOGIN -p$PASS acsmain
echo "set eltex_ont"
pv ./eltex_ont.sql | mysql -u$LOGIN -p$PASS eltex_ont
echo "set wireless"
pv ./wireless.sql | mysql -u$LOGIN -p$PASS wireless
echo "set eltex_auth_service"
pv ./eltex_auth_service.sql | mysql -u$LOGIN -p$PASS eltex_auth_service
echo "set payments"
pv ./payments.sql | mysql -u$LOGIN -p$PASS payments
echo "set eltex_alert"
pv ./eltex_alert.sql | mysql -u$LOGIN -p$PASS eltex_alert
echo "set ELTEX_PORTAL"
pv ./ELTEX_PORTAL.sql | mysql -u$LOGIN -p$PASS ELTEX_PORTAL
echo "set radius"
pv ./radius.sql | mysql -u$LOGIN -p$PASS radius
echo "set eltex_wifi_customer_cab"
pv ./eltex_wifi_customer_cab.sql | mysql -u$LOGIN -p$PASS eltex_wifi_customer_cab
echo "set eltex_pcrf"
pv ./eltex_pcrf.sql | mysql -u$LOGIN -p$PASS eltex_pcrf
echo "set eltex_ngw"
pv ./eltex_ngw.sql | mysql -u$LOGIN -p$PASS eltex_ngw
echo "set eltex_ott"
pv ./eltex_ott.sql | mysql -u$LOGIN -p$PASS eltex_ott
echo "set eltex_jerry"
pv ./eltex_jerry.sql | mysql -u$LOGIN -p$PASS eltex_jerry
echo "set eltex_wids"
pv ./eltex_wids.sql | mysql -u$LOGIN -p$PASS eltex_wids
echo "set eltex_jobs"
pv ./eltex_jobs.sql | mysql -u$LOGIN -p$PASS eltex_jobs
echo "set eltex_bruce"
pv ./eltex_bruce.sql | mysql -u$LOGIN -p$PASS eltex_bruce
echo "set Syslog"
pv ./Syslog.sql | mysql -u$LOGIN -p$PASS Syslog
echo "set information_schema"
pv ./information_schema.sql | mysql -u$LOGIN -p$PASS information_schema
echo "set mysql"
pv ./mysql.sql | mysql -u$LOGIN -p$PASS mysql
echo "set performance_schema"
pv ./performance_schema.sql | mysql -u$LOGIN -p$PASS performance_schema
echo "set sys"
pv ./sys.sql | mysql -u$LOGIN -p$PASS sys
echo "set eltex_sorm2"
pv ./eltex_sorm2.sql | mysql -u$LOGIN -p$PASS eltex_sorm2
echo "All databases are set"
