From d5773ab38c1bc4514be798df618bdafbe26f4f55 Mon Sep 17 00:00:00 2001 From: Saku Ytti Date: Thu, 26 Mar 2015 23:55:17 +0200 Subject: rename file --- lib/oxidized/model/junos.rb | 2 +- lib/oxidized/model/mikrotik.rb | 17 ----------------- lib/oxidized/model/routeros.rb | 17 +++++++++++++++++ 3 files changed, 18 insertions(+), 18 deletions(-) delete mode 100644 lib/oxidized/model/mikrotik.rb create mode 100644 lib/oxidized/model/routeros.rb diff --git a/lib/oxidized/model/junos.rb b/lib/oxidized/model/junos.rb index 70f0956..e43d71a 100644 --- a/lib/oxidized/model/junos.rb +++ b/lib/oxidized/model/junos.rb @@ -9,7 +9,7 @@ class JunOS < Oxidized::Model cmd :all do |cfg| # we don't need screen-scraping in ssh due to exec cfg = cfg.lines.to_a[1..-2].join if telnet - cfg + cfg.lines.map { |line| line.rstrip }.join "\n" end cmd :secret do |cfg| diff --git a/lib/oxidized/model/mikrotik.rb b/lib/oxidized/model/mikrotik.rb deleted file mode 100644 index bd588b7..0000000 --- a/lib/oxidized/model/mikrotik.rb +++ /dev/null @@ -1,17 +0,0 @@ -class RouterOS < Oxidized::Model - prompt /^\[\w+@\S+\]\s?>\s?$/ - comment "# " - - cmd '/system routerboard print' do |cfg| - comment cfg - end - - cmd '/export' do |cfg| - cfg = cfg.split("\n").select { |line| not line[/^\#\s\w{3}\/\d{2}\/\d{4}.*$/] } - cfg.join("\n") + "\n" - end - - cfg :ssh do - exec true - end -end diff --git a/lib/oxidized/model/routeros.rb b/lib/oxidized/model/routeros.rb new file mode 100644 index 0000000..bd588b7 --- /dev/null +++ b/lib/oxidized/model/routeros.rb @@ -0,0 +1,17 @@ +class RouterOS < Oxidized::Model + prompt /^\[\w+@\S+\]\s?>\s?$/ + comment "# " + + cmd '/system routerboard print' do |cfg| + comment cfg + end + + cmd '/export' do |cfg| + cfg = cfg.split("\n").select { |line| not line[/^\#\s\w{3}\/\d{2}\/\d{4}.*$/] } + cfg.join("\n") + "\n" + end + + cfg :ssh do + exec true + end +end -- cgit v1.2.1