#!/bin/sh

read -p "DB URL? " URL
read -p "IP:PORT? " IP
read -p "DB name? " DBNAME

wget $URL -O dbs.html
grep export dbs.html |  awk -F'"' '{print $2}' | sed "s|^|$IP|g" > dbs.txt

FILES=$(cat dbs.txt)
mkdir $DBNAME;cd $DBNAME
for file in $FILES; do
    wget $file
done
