This is a continuation of a script I got help on a few weeks ago. I got everything working, unfortunately the scenario has changed a bit and I'm under a little pressure to get this up and running so I was hoping someone here would help me quickly modify this script.

Here are the basics. The purpose of the script is to recapture a specific floating IP. Due to system limitations, the only way to do this currently is by kinda playing the lottery... The script requests a pool of floating IP's and puts them in a table that looks like this:

```
+------------+-----------+----------+---------------+
| Ip         | Server Id | Fixed Ip | Pool          |
+------------+-----------+----------+---------------+
| 10.10.10.1 |           | -        | floating-pool |
| 10.10.10.2 |           | -        | floating-pool |
| 10.10.10.3 |           | -        | floating-pool |
| 10.10.10.4 |           | -        | floating-pool |
| 10.10.10.5 |           | -        | floating-pool |
+------------+-----------+----------+---------------+

```

The script then checks to see if the floating IP we are looking for is in that table, ie has been captured. If not, the script returns all IP's back to the pool and tries again. If the address we are looking for has been captured, then the script drops all other IP's and terminates.

The current version of this script works great to capture a single IP, but now we need it to capture several IP's. Here is the old single IP version:

```
#!/bin/bash
# Floating IP Reclaimer

################# CONFIG ##################
float="10.10.10.3"
tenantid="blah"
###########################################

# Start
clear
loop=true
if ! [ "$tenantid" = "$OS_TENANT_ID" ]; then
        echo "ERROR - Be sure you have sourced the proper tenant ID!"
else
        l=1
        while $loop; do
                printf "Floating IP Reclaimer\n\n"
                printf "Requesting address block...\n"
                for ((i=1;i<=5;i++));
                do
                        nova floating-ip-create floating-pool > /dev/null 2>&1
                done
                printf "Checking for matches...\n"
                nova floating-ip-list > /tmp/block
                while read garbage1 ip garbage2;
                do
                        if [ "$ip" != "$float" ]; then
                                printf "Releasing $ip\n"
                                nova floating-ip-delete "$ip" > /dev/null 2>&1
                        else
                                loop=false
                        fi
                done < <(tail -n +4 /tmp/block | head -n -1)
                printf "\nFloating IP blocks searched: "$l
                l=$((l+1))
                clear
        done
        printf "\nFloating IP reclaimed!\n\n"
fi

```

Thank you everyone for the help. I'm working on a solution as we speak. Unfortunately, sometimes I don't work too well under pressure.

Thanks!