-
Notifications
You must be signed in to change notification settings - Fork 909
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2916 from sugresmax/master
AddPack, Zyxel Adsl modems support
- Loading branch information
Showing
5 changed files
with
79 additions
and
4 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
class AddPack < Oxidized::Model | ||
# Used in AddPack Voip, such as AP100B, AP100_G2, AP700, AP1000, AP1100F | ||
|
||
using Refinements | ||
PROMPT = /^.*[>#]\s?$/ | ||
|
||
expect /-- [Mm]ore --/ do |data, re| | ||
send ' ' | ||
data.sub re, '' | ||
end | ||
|
||
prompt PROMPT | ||
cmd 'enable' | ||
|
||
cmd 'show running-config' do |cfg| | ||
cfg.gsub! /^Building configuration.../, '' | ||
cfg.gsub! /^*show running-config/, '' | ||
cfg.gsub! PROMPT, '' | ||
cfg | ||
end | ||
|
||
cfg :telnet do | ||
username /[Ll]ogin:\s?/ | ||
password /[Pp]assword:\s?/ | ||
end | ||
end |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
class ZyNOSADSL < Oxidized::Model | ||
using Refinements | ||
|
||
# Used in Zyxel ADSL, such as AAM1212-51 | ||
|
||
prompt /^.*>\s?$/ | ||
comment ';; ' | ||
|
||
cmd 'config show all nopause' | ||
|
||
cfg :telnet do | ||
password /^Password:/i | ||
end | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
class ZyNOSMGS < Oxidized::Model | ||
using Refinements | ||
|
||
PROMPT = /^(\w.*)>(.*)?$/ | ||
# Used in Zyxel MGS Series switches | ||
|
||
prompt PROMPT | ||
comment '! ' | ||
|
||
cmd 'show version' do |cfg| | ||
clear_output cfg | ||
end | ||
|
||
cmd 'show running-config' do |cfg| | ||
clear_output cfg | ||
end | ||
|
||
cfg :telnet do | ||
username /^User\s?name(\(1-32 chars\))?:/i | ||
password /^Password(\(1-32 chars\))?:/i | ||
end | ||
|
||
cfg :telnet, :ssh do | ||
pre_logout 'exit' | ||
end | ||
|
||
private | ||
|
||
def clear_output(output) | ||
output.gsub PROMPT, '' | ||
end | ||
end |