Skip to content

Instantly share code, notes, and snippets.

@Nalorokk
Created November 13, 2018 15:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nalorokk/a04be394859fe3cdeb8b6177c0704d64 to your computer and use it in GitHub Desktop.
Save Nalorokk/a04be394859fe3cdeb8b6177c0704d64 to your computer and use it in GitHub Desktop.
Unlock bitbucket
#!/usr/bin/php
<?php
$list = json_decode(file_get_contents('https://ip-ranges.atlassian.com/'), true);
foreach ($list['items'] as $item) {
$cidr = $item['cidr'];
if (strpos($cidr, ':') === false) {
echo "Adding $cidr\n";
system('ip route add ' . escapeshellarg($cidr) . ' dev tun0');
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment