3
This commit is contained in:
parent
47ab26db92
commit
b627bd3a2c
4
README.md
Normal file
4
README.md
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
## Example
|
||||||
|
```
|
||||||
|
ruby gen-rsc.rb il-domains.txt IL_SPEEDTEST_DOMS
|
||||||
|
```
|
19
gen-rsc.rb
Executable file
19
gen-rsc.rb
Executable 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
|
Loading…
Reference in New Issue
Block a user