diff options
author | ytti <saku@ytti.fi> | 2015-08-15 13:04:58 +0300 |
---|---|---|
committer | ytti <saku@ytti.fi> | 2015-08-15 13:04:58 +0300 |
commit | fed87174a3e1c1aa2bf5898548f164841e8a7aa0 (patch) | |
tree | 3cd43b0a673068577a24788b5d75b1d6a3ee9ab2 /lib/oxidized/model/routeros.rb | |
parent | 5f892762c05e425f8d4d0d8b36371ed0e9114ca2 (diff) | |
parent | 2216e945ae4ff51904f13cc2387507cf690de8c2 (diff) |
Merge pull request #161 from MrRJ45/patch-2
Update routeros.rb
Diffstat (limited to 'lib/oxidized/model/routeros.rb')
-rw-r--r-- | lib/oxidized/model/routeros.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/oxidized/model/routeros.rb b/lib/oxidized/model/routeros.rb index bd588b7..3ee40fc 100644 --- a/lib/oxidized/model/routeros.rb +++ b/lib/oxidized/model/routeros.rb @@ -1,5 +1,5 @@ class RouterOS < Oxidized::Model - prompt /^\[\w+@\S+\]\s?>\s?$/ + prompt /\[\w+@\S+\]\s?>\s?$/ comment "# " cmd '/system routerboard print' do |cfg| @@ -7,10 +7,16 @@ class RouterOS < Oxidized::Model end cmd '/export' do |cfg| + cfg.gsub! /\[(?:\d+)?(?:;\d+)?(?:m)?/, '' # strip ANSI colours cfg = cfg.split("\n").select { |line| not line[/^\#\s\w{3}\/\d{2}\/\d{4}.*$/] } cfg.join("\n") + "\n" end + cfg :telnet do + username /^Login:/ + password /^Password:/ + end + cfg :ssh do exec true end |