Created
November 20, 2014 15:31
-
-
Save pkrumins/d50d7e12492362fcbbf5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iptables.list('Tunnels', function (rules) { | |
var ports = {}; | |
rules.forEach(function (rule) { | |
if (rule.parsed.target == 'REJECT') return; | |
// extract tcp destination ports | |
var match = rule.raw.match(/tcp dpt:(\d+)/); | |
if (match) { | |
ports[parseInt(match[1])] = 1; | |
} | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment