speedtest-domains/gen-rsc.rb

20 lines
379 B
Ruby
Raw Normal View History

2024-05-22 09:36:57 +03:00
#!/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