20 lines
379 B
Ruby
20 lines
379 B
Ruby
|
#!/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
|