Skip to content

Instantly share code, notes, and snippets.

@KyMidd
Created November 22, 2019 03:55
Show Gist options
  • Save KyMidd/d29efe21f095c8bb7d9e734423dfc64c to your computer and use it in GitHub Desktop.
Save KyMidd/d29efe21f095c8bb7d9e734423dfc64c to your computer and use it in GitHub Desktop.
# Write dynamic
input="CIDRlist"
while IFS= read -r read
do
subnet=$(echo "${read%%/*}")
netmask=$(ipcalc -m "$read")
netmask=$(echo "${netmask#*=}")
echo " - network-object $subnet $netmask" >> AWS2ASAPlaybook
done < "$input"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment