#!/bin/bash

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


LOGIN=$1  
PASS=$2 


echo "ems"
mysqldump -u$LOGIN -p$PASS eltex_ems --routines=true --triggers=true | pv > ./eltex_ems.sql
echo "ems"
mysqldump -u$LOGIN -p$PASS acsmain --routines=true --triggers=true | pv > ./acsmain.sql
echo "ont"
mysqldump -u$LOGIN -p$PASS eltex_ont --routines=true --triggers=true | pv > ./eltex_ont.sql
echo "wireless"
mysqldump -u$LOGIN -p$PASS wireless --routines=true --triggers=true | pv > ./wireless.sql
echo "auth-service"
mysqldump -u$LOGIN -p$PASS eltex_auth_service --routines=true --triggers=true | pv > ./eltex_auth_service.sql
echo "ngw"
mysqldump -u$LOGIN -p$PASS eltex_ngw --routines=true --triggers=true | pv > ./eltex_ngw.sql
echo "alert"
mysqldump -u$LOGIN -p$PASS eltex_alert --routines=true --triggers=true | pv > ./eltex_alert.sql
echo "portal"
mysqldump -u$LOGIN -p$PASS ELTEX_PORTAL --routines=true --triggers=true | pv > ./ELTEX_PORTAL.sql
echo "radius"
mysqldump -u$LOGIN -p$PASS radius  --routines=true --triggers=true | pv > ./radius.sql
echo "bruce"
mysqldump -u$LOGIN -p$PASS eltex_bruce  --routines=true --triggers=true | pv > ./eltex_bruce
echo "doors"
mysqldump -u$LOGIN -p$PASS eltex_doors  --routines=true --triggers=true | pv > ./eltex_doors
