From b627bd3a2c5b1d42af0a54b8c147881985383811 Mon Sep 17 00:00:00 2001 From: Eliezer Croitoru Date: Wed, 22 May 2024 09:36:57 +0300 Subject: [PATCH] 3 --- README.md | 4 ++++ gen-rsc.rb | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 README.md create mode 100755 gen-rsc.rb 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