Guest User

Untitled

a guest
Nov 25th, 2017
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. class Nortel < Oxidized::Model
  2. # nortel switch config download
  3. prompt /^>>.+\#\s/
  4. comment '/* '
  5. cmd '/info/sys/general' do |c|
  6. comment c
  7. end
  8. cmd '/info/link' do |c|
  9. comment c
  10. end
  11. cmd '/info/port' do |c|
  12. comment c
  13. end
  14. cmd '/cfg/dump'
  15. cmd '/info/sys/chassis' do |c|
  16. comment c
  17. end
  18. cmd '/boot/cur' do |c|
  19. comment c
  20. end
  21.  
  22. # cleanup function, pager can't be turned off ;/
  23. cmd :all do |data|
  24. out = ""
  25. data.split("\n").each do |data|
  26. if data !~ /.*\x27.*/ && data !~ /^.*\x08\x20\x08.*/
  27. out = out + data + "\n"
  28. data = ""
  29. else
  30. data.gsub!(/.*\x08/,'')
  31. data.gsub!(/.*\x27/,'')
  32. out = out + data + "\n"
  33. end
  34. end
  35. out
  36. end
  37.  
  38. expect /.*any other key.*/ do |data, re|
  39. send ' '
  40. data.sub re, ''
  41. end
  42.  
  43. # cfg :ssh do
  44. # username /^login as:\s$/
  45. # password /^.+password:\s$/
  46. # pre_logout 'exit'
  47. # end
  48.  
  49. cfg :telnet do
  50. username /login username:/
  51. password /login password:/
  52. pre_logout 'exit'
  53. end
  54.  
  55. end
Add Comment
Please, Sign In to add comment