You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10 lines
666 B

#! /bin/bash
echo "UPDATE CIDR Colombia from http://www.ipdeny.com/ipblocks/data/countries/co.zone"
#wget http://www.ipdeny.com/ipblocks/data/countries/co.zone
# split -l 200 --numeric-suffixes co.zone co-zone-split-
for zone_file in $(ls -c1 co-zone-split-[0-09][0-9])
do
echo "Creating Zone ${zone_file}"
gcloud compute --project=ccoe-246623 firewall-rules create dc-sapian-gcp-allow-sbc-webrtc-${zone_file} --target-tags=sbcwebrtc --description="Allow HEP Service Homer/Sipcapture/HEP for Colombia CIDR" --direction=INGRESS --priority=1000 --network=default --action=ALLOW --rules=tcp:443 --source-ranges=$(sed -n '1h;2,$H;${g;s/\n/,/g;p}' ${zone_file})
done