diff --git a/README.md b/README.md new file mode 100644 index 0000000..2911a39 --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +## Example +``` +ruby gen-rsc.rb il-domains.txt IL_SPEEDTEST_DOMS +``` diff --git a/gen-rsc.rb b/gen-rsc.rb new file mode 100755 index 0000000..53638d8 --- /dev/null +++ b/gen-rsc.rb @@ -0,0 +1,19 @@ +#!/usr/bin/env ruby + +domainsFilename = ARGV[0] +addressListName = ARGV[1] + +if addressListName.nil? or domainsFilename.nil? + STDERR.puts("Missing cli arguments") + exit 1 +end + +domains = File.open(domainsFilename).readlines + +domains.each do |l| + l = l.chomp.strip + next if l.empty? + next if l[0] == "#" + + puts "/ip/firewall/address-list/add list=#{addressListName} address=#{l}" +end