mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 17:37:17 +02:00
15 lines
408 B
Ruby
15 lines
408 B
Ruby
module Iptable
|
|
def counter_update(registrar_code, ip)
|
|
counter_proc = "/proc/net/xt_recent/#{registrar_code}"
|
|
|
|
begin
|
|
File.open(counter_proc, 'a') do |f|
|
|
f.puts "+#{ip}"
|
|
end
|
|
rescue Errno::ENOENT => e
|
|
logger.error "ERROR: cannot open #{counter_proc}: #{e}"
|
|
rescue IOError => e
|
|
logger.error "ERROR: cannot write #{ip} to #{counter_proc}: #{e}"
|
|
end
|
|
end
|
|
end
|