Scrap IP+subnet from site and create Fortigate command file – address

Input full url (E.g.): https://www.blabla.com/muzipuzi
To generate file

#!/usr/bin/env bash

ipfile='All_ip.txt'
proccessedfile='FW_Commands.txt'
touch $ipfile
touch $proccessedfile

>$proccessedfile
>$ipfile

echo "Please enter full address"
read address

echo "Please enter service name"
read service

curl -s $address | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/.[0-9]{1,2}' | tee > $ipfile

counter=0

echo -e "config firewall address\n" >> $proccessedfile
while read line; do

echo " edit $service_$line" >> $proccessedfile
echo " set subnet $line" >> $proccessedfile

if [[ $counter -ge 15 ]]
then
str="end\n"
counter=0
else
str="next"
fi

echo -e "$str" >> $proccessedfile
let "counter=counter+1"
done <$ipfile
sed -i '$ d' $proccessedfile && echo "end" >> $proccessedfile
echo "Done, All ip's located at $ipfile , Command file located at $proccessedfile"