Skip to content

Instantly share code, notes, and snippets.

@vdo
Created June 4, 2019 12:24
Show Gist options
  • Save vdo/6b2c75a6d82fcf84f3965c8fd4f96afd to your computer and use it in GitHub Desktop.
Save vdo/6b2c75a6d82fcf84f3965c8fd4f96afd to your computer and use it in GitHub Desktop.
#!/bin/bash
PORT=5001
PROTO=tcp
TRAVIS_IPS=$(curl -s https://dnsjson.com/nat.travisci.net/A.json | jq -r '.results.records|sort|join(" ")')
for ip in ${TRAVIS_IPS[@]}; do
echo "Adding... $ip"
ufw allow from $ip to any proto $PROTO port $PORT
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment