Last active
July 22, 2020 19:10
-
-
Save XANi/502044d20852abf7c2c351a65f5a5fb2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Nortel < Oxidized::Model | |
# nortel switch config download | |
prompt /^>>.+\#\s/ | |
comment '/* ' | |
cmd '/info/sys/general' do |c| | |
comment c | |
end | |
cmd '/info/link' do |c| | |
comment c | |
end | |
cmd '/info/port' do |c| | |
comment c | |
end | |
cmd '/cfg/dump' | |
cmd '/info/sys/chassis' do |c| | |
comment c | |
end | |
cmd '/boot/cur' do |c| | |
comment c | |
end | |
# cleanup function, pager can't be turned off ;/ | |
cmd :all do |data| | |
out = "" | |
data.split("\n").each do |data| | |
if data !~ /.*\x27.*/ && data !~ /^.*\x08\x20\x08.*/ | |
out = out + data + "\n" | |
data = "" | |
else | |
data.gsub!(/.*\x08/,'') | |
data.gsub!(/.*\x27/,'') | |
out = out + data + "\n" | |
end | |
end | |
out | |
end | |
expect /.*any other key.*/ do |data, re| | |
send ' ' | |
data.sub re, '' | |
end | |
# cfg :ssh do | |
# username /^login as:\s$/ | |
# password /^.+password:\s$/ | |
# pre_logout 'exit' | |
# end | |
cfg :telnet do | |
username /login username:/ | |
password /login password:/ | |
pre_logout 'exit' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment