Skip to content

Commit

Permalink
Dlink - fixed prompt for other dlink switches, added additional uptim…
Browse files Browse the repository at this point in the history
…e removal expressions (#2794)
  • Loading branch information
mirackle-spb authored Jul 25, 2023
1 parent dab52d0 commit fd3608e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
+ Documentation to send mail with hooks

## Changed
- dlink: fixed prompt for other dlink switches, added additional uptime removal expressions (@mirackle-spb)

## Fixed

Expand Down
6 changes: 4 additions & 2 deletions lib/oxidized/model/dlink.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ class Dlink < Oxidized::Model
using Refinements

# D-LINK Switches
# Add support dgs 1100 series (tested only with dgs-1100-10/me)

prompt /^(\r*[\w\s.@()\/:-]+[#>]\s?)$/
prompt /[\w.@()\/:-]+[#>]\s?$/
comment '# '

cmd :secret do |cfg|
Expand All @@ -19,6 +18,9 @@ class Dlink < Oxidized::Model

cmd 'show switch' do |cfg|
cfg.gsub! /^System Uptime\s.+/, '' # Omit constantly changing uptime info
cfg.gsub! /^System up time\s.+/, '' # Omit constantly changing uptime info
cfg.gsub! /^System Time\s.+/, '' # Omit constantly changing uptime info
cfg.gsub! /^RTC Time\s.+/, '' # Omit constantly changing uptime info
comment cfg
end

Expand Down

0 comments on commit fd3608e

Please sign in to comment.