This commit is contained in:
Eliezer Croitoru 2024-05-22 09:36:57 +03:00
parent 47ab26db92
commit b627bd3a2c
2 changed files with 23 additions and 0 deletions

4
README.md Normal file
View File

@ -0,0 +1,4 @@
## Example
```
ruby gen-rsc.rb il-domains.txt IL_SPEEDTEST_DOMS
```

19
gen-rsc.rb Executable file
View File

@ -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